-
-
Save thinnker/b4e33dc5c20326255cc053232e10b4eb to your computer and use it in GitHub Desktop.
nginx config file for laravel with php7.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 DOMAIN_NAME; | |
| access_log /var/log/nginx/DOMAIN_NAME_access.log; | |
| error_log /var/log/nginx/DOMAIN_NAME_error.log; | |
| rewrite_log on; | |
| root /var/www/DOMAIN_NAME/public; | |
| index index.php index.html; | |
| location / { | |
| try_files $uri $uri/ /index.php?$query_string; | |
| } | |
| if (!-d $request_filename) { | |
| rewrite ^/(.+)/$ /$1 permanent; | |
| } | |
| location ~ \.php$ { | |
| include snippets/fastcgi-php.conf; | |
| fastcgi_pass unix:/run/php/php7.3-fpm.sock; | |
| } | |
| location ~ /\.ht { | |
| deny all; | |
| } | |
| # Set header expirations on per-project basis | |
| location ~* \.(?:ico|css|js|jpe?g|JPG|png|gif|svg|woff)$ { | |
| expires 365d; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment