Problems running the app

I have built the release for an app with Distillery but having problems running on the production server.Here’s the configuration fro /etc/nginx/sites-available/myapp

    upstream myapp {
    listen 80;

    location / {
        try_files $uri @proxy;

    location @proxy {
        include proxy_params;
        proxy_redirect off;
        proxy_pass http://myapp;
} takes me to the the default nginx page but shows the default page that I have configured for my phoenix app.

I don’t use nginx muchmyself, so am no expert on it, but location / is going to match … and that is set to be served by nginx directly. Try getting replacing the location / block with the contents of the location @proxy block.

(I used haproxy myself for these things, so I apologize in advance if the above is not correct; working off of my poor memory of how nginx config works…)

1 Like

Thanks @aseigo …tried it …it didn’t work

The try_files inside the default location / block will see if a local filename exists, and if so serve it, else it falls back to the proxy, so that is fine.

Given that, the configuration looks correct on an immediate guess without seeing your error logs, given that your proxy_params config is correct (which is not shown either, but assuming it is defaulted). Nothing in your error logs? No file being hosted as a fallback? Etc…?

Also, what do you mean by default page? If no filename existed at the $URI and the proxy did not return a success then it should fail pretty hard since you did not add a =404 handler at the end or so. If you are getting a page it will be coming from somewhere…

thanks @OvermindDL1…I had a quick look at the log file and this is one of the lines in the log

bind() to failed

I am very new to hosting…never done it before…so sorry if I am not making sense

Huh, do you have a listen 4000 or some other form in one of your nginx config files anywhere? It should not be.

Still though, that does not explain why you are seeing a page when you load port 80. What is the page you are seeing? Is the link public? Can you take a screenshot?