Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Systemd can make uwsgi work but not nginx (502 Bad gateway)

$
0
0
I can start uwsgi either from the shell or enabling / starting it via systemctl. In both cases the site or the test.py file works well only when I start nginx from the shell. But when I start nginx via systemctl I get 502 Bad gateway.

I looked at processes and even if I start nginx manually or via systemctl, it is run by user nginx, no difference.

The nginx.service file is the default one installed from EPEL and almost identical to the example on this website, but none of these service files make nginx work well. I don't think its the problem with socket permissions as I've made it work whith nginx started manually, and even if I switch to use IP port instead, systemctl wont make nginx work well.


[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>