Welcome! Log In Create A New Profile


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

Posted by id042016 
Systemd can make uwsgi work but not nginx (502 Bad gateway)
April 12, 2016 05:43PM
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.

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

ExecStartPre=/usr/sbin/nginx -t
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 55
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready