Skip to content

Instantly share code, notes, and snippets.

@ShapeLayer
Created September 9, 2017 05:14
Show Gist options
  • Save ShapeLayer/9dac0c9a6a9e42c7c51e97d256d30493 to your computer and use it in GitHub Desktop.
Save ShapeLayer/9dac0c9a6a9e42c7c51e97d256d30493 to your computer and use it in GitHub Desktop.
server {
listen 80;
listen [::]:80;
root /usr/share/nginx/blog;
index index.php index.html index.htm;
server_name blog.hoparkgo9ma.work;
location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/blog;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment