Created
July 24, 2020 09:23
-
-
Save kayintveen/5c1574cf42cf1ecd47ed4573598e7efc to your computer and use it in GitHub Desktop.
the nginx vhost i use for Laravel devlopment
This file contains 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 { | |
listen 80; | |
server_name local.PROJECTNAME.io; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name local.PROJECTNAME.io; | |
#ssl_certificate /Users/USERNAME/.ssl/PROJECTNAME.test.pem; | |
#ssl_certificate_key /Users/USERNAME/.ssl/PROJECTNAME.test-key.pem; | |
ssl_certificate /Users/USERNAME/.ssl/local.PROJECTNAME.io.pem; | |
ssl_certificate_key /Users/USERNAME/.ssl/local.PROJECTNAME.io-key.pem; | |
add_header X-Frame-Options "SAMEORIGIN"; | |
add_header X-XSS-Protection "1; mode=block"; | |
add_header X-Content-Type-Options "nosniff"; | |
root /Users/USERNAME/sites/PROJECTNAME/public; | |
index index.php | |
gzip on; | |
gzip_vary on; | |
gzip_disable "msie6"; | |
gzip_comp_level 6; | |
gzip_min_length 1100; | |
gzip_buffers 16 8k; | |
gzip_proxied any; | |
gzip_types | |
text/plain | |
text/css | |
text/js | |
text/xml | |
text/javascript | |
application/javascript | |
application/x-javascript | |
application/json | |
application/xml | |
application/xml+rss; | |
error_log /var/log/nginx/PROJECTNAME_error.log; | |
access_log /var/log/nginx/PROJECTNAME_access.log; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } | |
error_page 404 /index.php; | |
location ~ \.php$ { | |
fastcgi_pass 127.0.0.1:9073; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
location ~ /\.(?!well-known).* { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment