Skip to content

nginx: add www subdomain & redirect as default #58

@cybrmakr

Description

@cybrmakr

NGINX forwarding

It's common to have a server blocks regarding forwarding like this :)

server {
listen 80;
server_name www.example.com;
return 301 http://example.com$request_uri;
}

server {
listen 80;
server_name example.com;
...
}

Would be amazing if this could be added to Ansible in order to configure this in nginx automatically.
Same applies to HTTPS, right? Also, is it possible to enter subdomains in the Ansible script for gettings certificates via certbot for both,
www.example.com as well as example.com itself.

Currently when opening browsing the www. version nginx default page appears. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions