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

Fixed app/templates/new_domain.j2 #22

Closed
wants to merge 1 commit into from

Conversation

narate
Copy link

@narate narate commented Jun 25, 2020

Fix invalid Nginx config template and change access_log to /tmp/{{ name }}.access.log to avoid file permission.

from

{
    listen          80;
    server_name     {{ name }},
    access_log      logs/{{ name }}.access.log main;

    location / {
        proxy_pass      http://127.0.0.1:8080;
    }

}

to

server {
    listen          80;
    server_name     {{ name }};
    access_log      /tmp/{{ name }}.access.log main;

    location / {
        proxy_pass  http://127.0.0.1:8080;
    }
}

@LucaNerlich
Copy link
Contributor

why do you want to store the logs in /tmp/?

@narate
Copy link
Author

narate commented Jun 25, 2020

The default user for run nginx in nginx docker image is nginx, but logs/* permission is for root:root.

Then if we run nginx -t will get error

nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2020/06/25 20:06:24 [emerg] 25#25: open() "/etc/nginx/logs/test.com.access.log" failed (2: No such file or directory)
nginx: [emerg] open() "/etc/nginx/logs/test.com.access.log" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed

@narate
Copy link
Author

narate commented Jun 25, 2020

I think access_log /dev/stdout main; is fine for docker container

@schenkd schenkd self-requested a review June 26, 2020 05:44
@schenkd
Copy link
Owner

schenkd commented Jun 26, 2020

Hello @narate, thank you very much for your contribution. The default template is only a minimal template. When creating a new domain, everyone has the possibility to customize it. This will be fundamentally revised in the next release anyway. For your problem with the access log I see the change of the path as a workaround and no solution for the permission problem. Therefore I have to decline this PR.

@schenkd schenkd closed this Jun 26, 2020
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.

3 participants