Giter VIP home page Giter VIP logo

ansible-nginx's People

Contributors

codesplicer avatar franklinkim avatar goetzk avatar timka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible-nginx's Issues

"daemon" directive is duplicate

I'm getting this error on Ubuntu 14.04:

2015/05/25 13:08:32 [emerg] 18720#0: "daemon" directive is duplicate in /etc/nginx/nginx.conf:17

Commenting out line 17:

Determines whether nginx should become a daemon

daemon {{ nginx_daemon }};

Seems to resolve the issue.

Overriding site template file

How does template lookup find the site config template specified as item.template? Where do I put it? Putting in the playbook file's directory doesn't work neither does templates subdir there.

AFAIU, the approach suggested here suggests creating a local role w/ the same name that contains only the template file, but this seems to override the tasks as well resulting in an empty local role.

Reverse proxy support

Hi,

I'm using this role with the following configuration and template to give myself a reverse proxy configuration.
I'm wondering if you are interested in having in built support for reverse proxies like this and if yes which bits you'd like to see made configurable.
Things I'm guessing you'd like to see configurable are listed below but do you have any others?

  • listen directives
  • client_max_body_size ?
  • keepalive_timeout?
  • proxy_pass target host+port

If you're interested I'll put together a PR for a more detailed review.

nginx_sites:
  - id: credentials
    name: "example.com"
    ip: x.x.x.x
    state: present
    add_webroot: no
    aliases:
      - "alias.example.com"
    template: templates-shared/nginx-with-https-upgrade.tmpl
    webroot: "/srv/x/webroot"
    # Where the .well-known folder sits in
    wellknown: "/srv/x/letsencrypt"
    redirects:
      - "{{ another.example.com }}"
      - "{{ something.example.com }}.au"
    ssl:
      cert_path: /etc/letsencrypt/live/{{ x }}
      cert_name: fullchain.pem
      key_name: privkey.pem
    rules: []
    append: ''
cat reverse-proxy.j2 
# {{ ansible_managed }}
# HTTPS terminating proxy sitting in front of webapp.
# TODO: Check: Some of this file can probably be removed with no loss in functionality.

# default_server on listen is required to work around bug https://github.com/certbot/certbot/issues/5817#issuecomment-391051737
server {
    server_name {{ item.name }}{% for value in item.aliases|default([]) %} {{ value }}{% endfor %};

    return 301 https://$host$request_uri;

    listen 80 ;
    return 404;
}

server {
    server_name {{ item.name }}{% for value in item.aliases|default([]) %} {{ value }}{% endfor %};

    charset utf-8;
    keepalive_timeout 65;
    client_max_body_size 128M;
    gzip_types text/css application/javascript text/javascript text/plain text/xml application/xml;
    gzip_vary on;

    root {{ item.webroot }};

    # Letsencrypt
    location /.well-known {
        alias {{ item.wellknown }}/.well-known;
    }

    location / {
        proxy_pass http://127.0.0.1:8000/;
        proxy_set_header Host $host;
        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;
    }

    listen 443 ssl;
    ssl_certificate {{ item.ssl.cert_path |default(openssl_certs_path) }}/{{ item.ssl.cert_name|default('server.crt') }};
    ssl_certificate_key {{ item.ssl.cert_path |default(openssl_keys_path) }}/{{ item.ssl.key_name|default('server.key') }};

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.