Created
June 6, 2019 13:18
-
-
Save Ramonymous/5a9996d68848c6557b5672f073fb012d to your computer and use it in GitHub Desktop.
Nginx virtualhost for running laravel with php 7.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| server_name panel.ramonymous.store; ##change to your domain | |
| root /var/www/panel/public/public/; ##change to your laravel project public dir | |
| index index.php index.html index.htm; | |
| location / { | |
| try_files $uri $uri/ /index.php$is_args$args; | |
| } | |
| # pass the PHP scripts to FastCGI server listening on /var/run/php-fpm/php-fpm.sock | |
| location ~ \.php$ { | |
| try_files $uri /index.php =404; | |
| fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; | |
| fastcgi_index index.php; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| include fastcgi_params; | |
| } | |
| # its Auto created by certbot if you not use ssl just remove or edit to your ssl directory | |
| listen 443 ssl; # managed by Certbot | |
| ssl_certificate /etc/letsencrypt/live/panel.ramonymous.store/fullchain.pem; # managed by Certbot | |
| ssl_certificate_key /etc/letsencrypt/live/panel.ramonymous.store/privkey.pem; # managed by Certbot | |
| include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | |
| ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | |
| } | |
| server { | |
| if ($host = panel.ramonymous.store) { | |
| return 301 https://$host$request_uri; | |
| } # managed by Certbot | |
| listen 80; | |
| server_name panel.ramonymous.store; | |
| return 404; # managed by Certbot | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment