Commit b39e9091 by Feanil Patel

Add nginx tasks to xserver.

parent 57433cb2
- name: restart nginx
service: name=nginx state=restarted
...@@ -44,4 +44,6 @@ ...@@ -44,4 +44,6 @@
- name: setup upstart script - name: setup upstart script
template: src=xserver.conf.j2 dest=/etc/init/xserver.conf owner=root group=root template: src=xserver.conf.j2 dest=/etc/init/xserver.conf owner=root group=root
- include: nginx.yml
- include: deploy.yml - include: deploy.yml
- name: add xserver nginx configuration
template: src=simple-proxy.j2 dest=/etc/nginx/sites-available/simple-proxy
notify:
- restart nginx
- name: enable xserver nginx configuration
file: src=/etc/nginx/sites-available/simple-proxy dest=/etc/nginx/sites-enabled/simple-proxy state=link
notify:
- restart nginx
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
upstream app_server {
# For a TCP configuration:
server 127.0.0.1:{{ xserver_port }} fail_timeout=0;
}
server {
listen {{ xserver_nginx_port }} default_server;
location / {
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_server;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment