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

Update NGINX File to combined log #5

Merged
merged 2 commits into from
Nov 10, 2021
Merged

Conversation

ncorder
Copy link
Contributor

@ncorder ncorder commented Nov 5, 2021

https://nginx.org/en/docs/http/ngx_http_log_module.html


Let me know if I am incorrect, but I believe main may have been an improperly syntaxed log format

@dessalines
Copy link
Member

What's the point of this / what does it solve?

@ncorder
Copy link
Contributor Author

ncorder commented Nov 6, 2021

What's the point of this / what does it solve?

With the current docker setup the log format does not work. Here, I'll post some information in a minute and relaunch my instance, I should have provided a log file to begin with.

@ncorder
Copy link
Contributor Author

ncorder commented Nov 6, 2021

root@lemmy:/home/user/lemmy# sudo systemctl start nginx
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
root@lemmy:/home/user/lemmy# systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2021-11-05 20:41:59 CDT; 11s ago
       Docs: man:nginx(8)
    Process: 13750 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
        CPU: 8ms

Nov 05 20:41:59 <domain> systemd[1]: Starting A high performance web server and a reverse proxy server...
Nov 05 20:41:59 <domain> nginx[13750]: nginx: [emerg] unknown log format "main" in /etc/nginx/sites-enabled/lemmy.conf>
Nov 05 20:41:59 <domain> nginx[13750]: nginx: configuration file /etc/nginx/nginx.conf test failed
Nov 05 20:41:59 <domain> systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Nov 05 20:41:59 <domain> systemd[1]: nginx.service: Failed with result 'exit-code'.
Nov 05 20:41:59 <domain> systemd[1]: Failed to start A high performance web server and a reverse proxy server.
root@lemmy:/home/user/lemmy# 

I replaced my domain with <domain> for privacy reasons.

@dessalines
Copy link
Member

nginx version?

@ncorder
Copy link
Contributor Author

ncorder commented Nov 8, 2021

root@lemmy:/home/user/lemmy# nginx -v
nginx version: nginx/1.18.0
root@lemmy:/home/user/lemmy#

@dessalines
Copy link
Member

I spose we can use the default combined, but in that case also remove the log format line above.

@ncorder
Copy link
Contributor Author

ncorder commented Nov 9, 2021

@dessalines Would you rather rename the log format lemmy_main to instead be calledmain or change where main is called to instead call lemmy_main.

Setting logs to combined also does not result in any errors for NGINX, yet.
let me know how you wish to resolve this issue.

@dessalines
Copy link
Member

That entire log_format line can be gotten rid of then, since combined already has its own format.

@ncorder
Copy link
Contributor Author

ncorder commented Nov 9, 2021

👍 That works

@dessalines
Copy link
Member

Looks good, thx!

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.

None yet

2 participants