Last active
January 2, 2016 21:19
-
-
Save peter-mcconnell/8362530 to your computer and use it in GitHub Desktop.
a few common nginx vhost references for quick copy/paste
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 | |
| { | |
| listen 443; | |
| ssl on; | |
| ssl_certificate /usr/ssl/server.crt; | |
| ssl_certificate_key /usr/ssl/server.key; | |
| ... | |
| access_log /var/log/nginx/site.access.log; | |
| error_log /var/log/nginx/site.error.log; | |
| ... | |
| location / { | |
| auth_basic "Restricted"; | |
| auth_basic_user_file htpasswd.d/thissiteshtpasswd; | |
| try_files $uri $uri/ /index.php?url=$uri&$args; | |
| } | |
| ... | |
| location ~ \.php$ | |
| { | |
| try_files $uri =404; | |
| include /etc/nginx/fastcgi_params; | |
| fastcgi_pass 127.0.0.1:6000; | |
| fastcgi_index index.php; | |
| fastcgi_param SCRIPT_FILENAME /var/www/example.com/public_html$fastcgi_script_name; | |
| fastcgi_param HTTPS on; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment