A list of configs specific to different environments.
Found at /usr/local/etc/nginx/
# sites-available/ | |
server { | |
listen 80; | |
server_name localhost; | |
#access_log logs/host.access.log main; | |
location / { | |
root html; | |
index index.html index.htm; | |
} | |
#error_page 404 /404.html; | |
# redirect server error pages to the static page /50x.html | |
# | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
} |
# sites-available/ | |
server { | |
listen 443; | |
server_name localhost; | |
ssl on; | |
ssl_certificate server.crt; | |
ssl_certificate_key server.key; | |
ssl_session_timeout 5m; | |
ssl_protocols SSLv2 SSLv3 TLSv1; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
ssl_prefer_server_ciphers on; | |
location / { | |
root html; | |
index index.html index.htm; | |
} | |
} |
# / | |
# user nobody; | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
include conf.d/*.conf; | |
include sites-enabled/*; | |
sendfile on; | |
keepalive_timeout 65; | |
} |
# conf.d/ | |
# tell php requests to be sent to where php-fpm is listening | |
upstream php { | |
server 127.0.0.1:9000; | |
} |
# sites-enabled/ | |
server { | |
server_name phppgadmin.dev; | |
access_log /usr/local/var/log/nginx/phppgadmin.access.log; | |
error_log /usr/local/var/log/nginx/phppgadmin.error.log; | |
location / { | |
root /Users/larry/Server/phppgadmin; | |
index index.html index.htm index.php; | |
} | |
location ~ \.php$ { | |
root /Users/larry/Server/phppgadmin; | |
fastcgi_pass php; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} |
# sites-enabled/ | |
server { | |
server_name sample.dev; | |
access_log /usr/local/var/log/nginx/sample.access.log; | |
error_log /usr/local/var/log/nginx/sample.error.log; | |
root /Users/larry/Server/sample; | |
index index.html index.htm index.php; | |
try_files $uri $uri/ /index.php?q=$uri&$args; | |
location ~ \.php$ { | |
root /Users/larry/Server/sample; | |
fastcgi_pass php; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
location / { | |
try_files $uri $uri/ /index.php?it=$uri&$args; | |
} | |
} |