Created
September 11, 2014 15:01
-
-
Save waynew/9ebe627502e1e1ac6df1 to your computer and use it in GitHub Desktop.
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
#/srv/salt/top.sls | |
base: | |
'myminion': | |
- myminion | |
#/srv/salt/myminion.sls | |
nginx: | |
pkg: | |
- installed | |
file.managed: | |
- name: /etc/nginx/nginx.conf | |
- source: salt://conf/nginx/nginx.conf | |
service: | |
- running | |
- enable: True | |
- reload: True | |
- watch: | |
- file: /etc/nginx/nginx.conf | |
- file: /etc/nginx/certs/snakeoil.crt | |
- file: /etc/nginx/certs/snakeoil.key | |
- file: /etc/nginx/sites-enabled/my_site | |
#/srv/salt/conf/nginx/nginx.conf | |
#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 /var/log/nginx/access.log main; | |
sendfile on; | |
#tcp_nopush on; | |
#keepalive_timeout 0; | |
keepalive_timeout 65; | |
gzip on; | |
include /etc/nginx/sites-enabled/*; | |
} | |
#../sites-enabled/my_site | |
# Change me bro | |
server { | |
listen 80; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name {{ grains.get('nginx_servername', 'localhost') }}; | |
ssl_certificate /etc/nginx/certs/snakeoil.crt; | |
ssl_certificate_key /etc/nginx/certs/snakeoil.key; | |
ssl_session_cache shared:SSL:1m; | |
ssl_session_timeout 5m; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
ssl_prefer_server_ciphers on; | |
charset utf-8; | |
access_log /var/log/nginx/host.access.log main; | |
location / { | |
proxy_pass http://localhost:9876; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Scheme $scheme; | |
proxy_read_timeout 2m; | |
proxy_connect_timeout 2m; | |
} | |
error_page 500 502 503 504 /media/50x.html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment