Created
April 24, 2013 02:55
-
-
Save outsideris/5449248 to your computer and use it in GitHub Desktop.
nginx setting skeleton
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user outsider; | |
worker_processes 4; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
'$status $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for"'; | |
#access_log logs/access.log main; | |
sendfile on; | |
#tcp_nopush on; | |
#keepalive_timeout 0; | |
keepalive_timeout 65; | |
gzip on; | |
gzip_vary on; | |
gzip_comp_level 3; | |
gzip_types text/plain text/css text/javascript application/x-javascript application/xml application/javascript; | |
server { | |
listen 80; | |
#server_name localhost; | |
#charset koi8-r; | |
#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; | |
} | |
#location /server-status { | |
# extended_status on; | |
# access_log off; | |
# allow 10.0.0.0/8; | |
#j allow 127.0.0.1; | |
# deny all; | |
# } | |
} | |
# HTTPS server | |
# | |
#server { | |
# listen 443; | |
# server_name localhost; | |
# ssl on; | |
# ssl_certificate cert.pem; | |
# ssl_certificate_key cert.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; | |
# } | |
#} | |
# vhost | |
include vhost/*.conf; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream servicename { | |
server 127.0.0.1:8080; | |
} | |
server { | |
listen 80; | |
#listen 443 ssl; | |
#server_name sideeffect.kr ~^REGEXP$; | |
server_name sideeffect.kr www.sideeffect.kr; | |
access_log /var/log/servicename_access.log; | |
error_log /var/log/servicename_error.log; | |
charset utf-8; | |
#keepalive_requests 1; | |
#keepalive_timeout 1s; | |
keepalive_requests 100; | |
keepalive_timeout 60; | |
#error_page 400 401 402 403 405 406 407 408 409 410 411 412 413 414 415 416 417 500 501 503 504 505 @internalerror; | |
#error_page 404 @notfound; | |
#location @internalerror { | |
# resolver 10.22.64.6; | |
# proxy_pass http://internalerror.html; | |
#} | |
#location @notfound { | |
# resolver 10.22.64.6; | |
# proxy_pass http://notfound.html; | |
#} | |
location /static/ { | |
root /www/public; | |
expires 1h; | |
} | |
location / { | |
proxy_pass http://servicename; | |
proxy_set_header Host $host:$server_port; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Forwarded-Port $server_port; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment