Skip to content

Instantly share code, notes, and snippets.

@mayormaier
Created May 12, 2022 20:31
Show Gist options
  • Save mayormaier/5bcbd7917276c4e7e953fc99d3a54440 to your computer and use it in GitHub Desktop.
Save mayormaier/5bcbd7917276c4e7e953fc99d3a54440 to your computer and use it in GitHub Desktop.
nginx conf for nginx tutorial
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 /images/ {
# Allow the contents of the /image folder to be listed
autoindex on;
access_log /var/log/nginx/wisdompetmed.local.images.access.log;
error_log /var/log/nginx/wisdompetmed.local.images.error.log;
}
location ~\.php {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_intercept_errors 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