0

I'm kind of new to deploying uSWGI python apps behind nginx as a reverse proxy, but so far I have had no trouble at all.

I have a small linode where I deploy all my python webapps simultaneously. As of yesterday I had two of them running on ports 8080 and 8090, yesterday I decided to deploy a default static site on my server root. It worked as expected. This web had a basic mailing form so I rebuild my IPTABLES to allow outgoing traffic for the mail port. (This is the only main change I made) And I decided to restart the linode in order to get everything in order.

After that I restarted both web apps, but somehow one of them (which works flawlessly in the local develpment enviroment) just returns a 401 error.

I really have no clue about what it could be, I have the same app runing in heroku as well and I have no problem there.

I have run out of ideas on what this could be.

This is my server block configuration for the app

server {

    # Running port
    listen 80;
    server_name bachmanager.com www.bachmanager.com;



    #logs
    access_log /var/www/BachApp/logs/access.log;
    error_log /var/www/BachApp/logs/errors.log;

    # Proxying connections to application servers
    location / {

        include            uwsgi_params;
        uwsgi_pass         uwsgiBach;

        proxy_redirect     off;
        proxy_set_header   Host www.bachmanager.com;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;

    }
}

I have loked around but every question or post about 401 talks about how to properly use it, it seems no one is getting this error by mistake...

I'm pretty sure this is a pretty basic question, but I cannot seem to be able to figure it out.

5
  • 1
    Why do you think you're getting a 401 error? What does it look like, and what does it say? Sep 4, 2014 at 3:15
  • Hello Michael, sorry if I was so unspecific, that's exactely how I feel about this. The message displayed by nginx is Unauthorized The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required. And I'm not asking for any credentials at this point in the app. If you are not logged in it should redirect to a login screen. I'm using Stormpath API to handle my credentials. Sep 5, 2014 at 13:27
  • Both deployments of the same app with the same controller can be compared here: linode deployment and heroku deployment I have never tried to restict access to anything with nginx, so I feel clueless about what could be causing this. Thanks for your help! Sep 5, 2014 at 13:27
  • That message comes from your application framework (Flask). It is not an nginx issue. Sep 5, 2014 at 13:38
  • Thanks a lot Michael, you were right. Will close this issue. Sep 5, 2014 at 16:51

1 Answer 1

0

As Michael posted, this message was sent by Flask, will investigate further and post a better answer here once I find out about it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .