Error 512 after nginx setup

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error 512 after nginx setup

Adrian Vidican
Hi Everyone,

First time I post here, hopefully I'm not gonna broke any rule.

I setup Nginx on my Ubuntu 16.04 server to point my domain (using cloudflare) to my server where discourse.org is installed.

Here's the default file in sites-available

server {
    listen 80; listen [::]:80;
    server_name stumblr.in;

    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name stumblr.in;

    ssl_certificate /etc/letsencrypt/live/stumblr.in/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/stumblr.in/privkey.pem;
    include /etc/nginx/snippets/ssl.conf;

    location / {
        proxy_pass http://stumblr.in:2045/;
        proxy_set_header Host $http_host;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect http://stumblr.in:2045/ https://stumblr.in;
    }
}


There's no error of Nginx but I've get 512 in browser.

Any idea what could be wrong?

Thanks in advance.
Adrian Vidican

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Error 512 after nginx setup

Francis Daly
On Sun, Mar 15, 2020 at 08:58:38PM +0200, Adrian Vidican wrote:

Hi there,

> I setup Nginx on my Ubuntu 16.04 server to point my domain (using cloudflare) to my server where discourse.org <http://discourse.org/> is installed.

Is there any evidence (logs, tcpdump) that the request got to your nginx
in the first place?

If not -- you have something outside of nginx to adjust, so that the
request gets that far.

Otherwise...

>     location / {
>         proxy_pass http://stumblr.in:2045/ <http://stumblr.in:2045/>;
>         proxy_set_header Host $http_host;
>         proxy_http_version 1.1;
>         proxy_set_header X-Forwarded-Proto $scheme;
>         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>         proxy_redirect http://stumblr.in:2045/ <http://stumblr.in:2045/> https://stumblr.in <https://stumblr.in/>;
>     }

> There's no error of Nginx but I've get 512 in browser.

Does your upstream port-2045 service return the 512 message?

(512 is not a standard http response code. So something must be creating
it specially.)

What response do you get if you use "curl -i" (or "curl -v") to make
the request? That is less likely to hide important information.

Cheers,

        f
--
Francis Daly        [hidden email]
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx