Skip to content

Instantly share code, notes, and snippets.

@telingadigital
Created February 4, 2018 11:40
Show Gist options
  • Save telingadigital/126ef82ef05ed24650dc83afa0ee7ece to your computer and use it in GitHub Desktop.
Save telingadigital/126ef82ef05ed24650dc83afa0ee7ece to your computer and use it in GitHub Desktop.
Default Server Block Nginx Configuration in Windows
server {
listen 80 default_server;
server_name _;
root c:/nginx/html;
location / {
index index.php index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment