Skip to content

Instantly share code, notes, and snippets.

@chrisdel101
Created August 30, 2020 23:11
Show Gist options
  • Save chrisdel101/2c4c1af0604526ed4628c1d8b6b74f1f to your computer and use it in GitHub Desktop.
Save chrisdel101/2c4c1af0604526ed4628c1d8b6b74f1f to your computer and use it in GitHub Desktop.
Nginx Ex
server {
listen 80 default_server;
root /var/www/wisdompetmed.local;
server_name wisdompetmed.local www.wisdompetmed.local;
index index.html index.htm index.php;
access_log /var/log/nginx/wisdompetmed.local.access.log;
error_log /var/log/nginx/wisdompetmed.local.error.log;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location /test/ {
try_files /var/www/test/ /var/www/test/index.html;
}
location /images/ {
# Allow the contents of the /image folder to be listed
access_log /var/log/nginx/wisdompetmed.local.images.access.log;
error_log /var/log/nginx/wisdompetmed.local.images.error.log;
autoindex on;
}
error_page 404 /404.html;
location = /404.html {
internal;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
internal;
}
location = /500 {
fastcgi_pass unix:/this/will/fail;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment