nginx error “page is temporarily unavailable”

Posted July 18, 2017 17.5k views

I’ve SSH installed a Python 3.5 application on CentOS along with uwsgi and nginx, but after doing asudo vi /etc/nginx/nginx.conf to edit the nginx config file as per usual, the response is currently:

nginx: [emerg] bind() to failed (98: Address already in use)

these are the contents of the /etc/nginx/nginx.conf file:

sendfile            on;
tcp_nopush          on;
tcp_nodelay         on;
keepalive_timeout   65;
types_hash_max_size 2048;

include             /etc/nginx/mime.types;
default_type        application/octet-stream;

include /etc/nginx/conf.d/*.conf;

server {
    listen      [::]:80 default_server;
    server_name  _;
    root         /var/www/html/<directory//;

    location / {

The server is currently showing an nginx error page

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

Hi @dev5

Can you run sudo nginx -t or sudo service nginx configtest to test your configuration.
And then post the last 30 lines from the error log also:

tail -30 /var/log/nginx/error.log


Uhm, but your Nginx has server_name localhost; which means it’s only accessible from the server itself.
Can you post your entire Nginx site configuration and your entire uWSGI?
And I would recommend that you do not have any server blocks in your main Nginx configuration located in /etc/nginx/nginx.conf

  • Config test was completed successfully with no syntax errors.

    2017/07/18 15:34:04 [crit] 2829#0: *41 connect() to unix:/var/www/html/pricing-service/socket.sock failed (2: No such file or directory) while connecting to upstream, client:, server: localhost, request: "HEAD HTTP/1.1", upstream: "uwsgi://unix:/var/www/html/pricing-service/socket.sock:", host: ""
    • @dev5

      But is the socket location in uWSGI the same as in Nginx?

      • [Nginx]

        server {
            listen 80;
            real_ip_header X-Forwarded-For;
            server_name localhost;
        location / {
            include uwsgi_params;
            uwsgi_pass unix:/var/www/html/pricing-service/socket.sock;
            uwsgi_modifier1 30;


        #application's base folder
        base = /var/www/html/pricing-service
        #python module to import
        app =
        module = %(app)
        home = %(base)/venv
        pythonpath = %(base)
        #socket file's location
        socket = /var/www/html/pricing-service/socket.sock

/etc/nginx/nginx.conf file:

and `/etc/init/uwsgi.conf config file:

  • @dev5
    But there’s no uwsgi_pass in that Nginx configuration. That’s just your main Nginx configuration. And the main Nginx configuration should not have any server blocks. And it looks like there’s multiple server blocks with the same information - all of them incorrect.
    Your server blocks should be located in separate files in /etc/nginx/default.d/*.conf