Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements uwsgi_pass + static assets support #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Implements uwsgi_pass + static assets support #4

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 23, 2017

This patch implements the support of uWSGI UNIX sockets into the ansible-nginx role and it does support as well static assets.

There's an example of usage in a playbook :

- role: nginx
  nginx_simple_uwsgi_passes:
    - server_name: example.org
      socket_path: /var/run/redmine.sock
      ssl_only: no
      static_root: /usr/share/redmine/public/
      static_paths:
        - /favicon.ico
        - /stylesheets/
        - /javascripts/
        - /images/
        - /plugin_assets/
        - /help/
        - /themes/

The generated virtual host will looks like this :

server {
    listen 80;
    listen 443 ssl;
    server_name example.org;

    include snippets/snakeoil.conf;

    location /favicon.ico {
        alias /usr/share/redmine/public//favicon.ico;
    }
    location /stylesheets/ {
        alias /usr/share/redmine/public//stylesheets/;
    }
    location /javascripts/ {
        alias /usr/share/redmine/public//javascripts/;
    }
    location /images/ {
        alias /usr/share/redmine/public//images/;
    }
    location /plugin_assets/ {
        alias /usr/share/redmine/public//plugin_assets/;
    }
    location /help/ {
        alias /usr/share/redmine/public//help/;
    }
    location /themes/ {
        alias /usr/share/redmine/public//themes/;
    }

    error_log /var/log/nginx/inframisc-prod01_error.log;
    access_log /var/log/nginx/inframisc-prod01_access.log;

    location / {
        uwsgi_pass  unix:/var/run/redmine.sock;
        include     uwsgi_params;
    }
}

In hope that will be merged. Thank you very much and have a great day !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants