Skip to content

Instantly share code, notes, and snippets.

@peter-mcconnell
Last active January 2, 2016 21:19
Show Gist options
  • Select an option

  • Save peter-mcconnell/8362530 to your computer and use it in GitHub Desktop.

Select an option

Save peter-mcconnell/8362530 to your computer and use it in GitHub Desktop.
a few common nginx vhost references for quick copy/paste
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