Skip to content

Instantly share code, notes, and snippets.

@hscstudio
Created February 12, 2018 06:04
Show Gist options
  • Save hscstudio/7e82cf2bfe8e350133c5efaee642ad94 to your computer and use it in GitHub Desktop.
Save hscstudio/7e82cf2bfe8e350133c5efaee642ad94 to your computer and use it in GitHub Desktop.
server {
listen 80 default_server;
server_name localhost;
#root /usr/share/nginx/html;
#root /var/www/html;
root /home/html;
index index.php index.html index.htm;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
try_files $uri $uri/ /index.php?$request_uri;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
location ~ \.php$ {
#try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment