Created
August 9, 2014 08:47
-
-
Save mrluanma/c7a79b0f5f80c54b05d1 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
upstream hurl_proxy { | |
server www.hurl.it; | |
keepalive 600; | |
} | |
server { | |
listen 80; | |
server_name hurl.example.com; | |
access_log /var/log/nginx/hurl_proxy.access.log; | |
error_log /var/log/nginx/hurl_proxy.error.log; | |
location / { | |
proxy_http_version 1.1; | |
proxy_set_header Host "www.hurl.it"; | |
proxy_set_header Connection ""; | |
proxy_redirect http://www.hurl.it/ /; | |
proxy_pass http://hurl_proxy; | |
# ngx_http_sub_module | |
# http://nginx.org/en/docs/http/ngx_http_sub_module.html | |
sub_filter "ajax.googleapis.com/ajax/libs/" "cdn.staticfile.org/"; | |
sub_filter_last_modified on; | |
sub_filter_once off; | |
} | |
} |
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
include: | |
- nginx | |
/etc/nginx/sites-available/hurl_proxy.conf: | |
file: | |
- managed | |
- source: salt://hurl_proxy/hurl_proxy.conf | |
- template: jinja | |
- user: root | |
- group: root | |
- mode: 644 | |
- watch_in: | |
- service: nginx | |
/etc/nginx/sites-enabled/hurl_proxy.conf: | |
file.symlink: | |
- target: /etc/nginx/sites-available/hurl_proxy.conf | |
- watch_in: | |
- service: nginx |
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
nginx-ppa: | |
pkgrepo.managed: | |
- ppa: nginx/stable | |
- require_in: | |
- pkg: nginx | |
nginx: | |
pkg: | |
- name: nginx-full | |
- installed | |
- refresh: True | |
service: | |
- running | |
- enable: True | |
- reload: True | |
- require: | |
- pkg: nginx | |
remove_default_site: | |
file: | |
- absent | |
- names: | |
- /etc/nginx/sites-available/default | |
- /etc/nginx/sites-enabled/default | |
- watch_in: | |
- service: nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment