Skip to content

Instantly share code, notes, and snippets.

@JoaoVagner
Created February 19, 2015 17:57
Show Gist options
  • Save JoaoVagner/fd9310942870c599112a to your computer and use it in GitHub Desktop.
Save JoaoVagner/fd9310942870c599112a to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name _;
access_log /var/log/nginx/blog-access.log ;
error_log /var/log/nginx/blog-error.log ;
location / {
root /var/www;
index index.html index.php;
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
root /var/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 443;
server_name _;
access_log /var/log/nginx/blog-ssl-access.log ;
error_log /var/log/nginx/blog-ssl-error.log ;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
location / {
root /var/www;
index index.html index.php;
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
root /var/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment