[SOLVED] Error 500 since nginx installation

magnum

Member
Aug 31, 2021
42
0
11
35
Hello,

i have a multihomed server and wanted to have a reverse proxy which can balance between all ip. Unfortunately, since i installed it, the gui isnt working properly. I cant open consoles and i have error 500: proxy not allowed everywhere

code_language.shell:
cat /etc/nginx/sites-enabled/proxmox
upstream proxmox {
    server lab1.work.com;
    server lab2.work.com;
    server lab3.work.com;
}

server {
    listen 80 default_server;
    rewrite ^(.*) https://$host$1 permanent;
}

server {
    listen 443;
    server_name _;
    ssl on;
    ssl_certificate /etc/pve/local/pve-ssl.pem;
    ssl_certificate_key /etc/pve/local/pve-ssl.key;
    proxy_redirect off;

    location / {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass https://localhost:8006;
        proxy_buffering off;
        client_max_body_size 0;
        proxy_connect_timeout  3600s;
        proxy_read_timeout  3600s;
        proxy_send_timeout  3600s;
        send_timeout  3600s;
    }

}
 
hi,

can you post the output from: ls -alR /etc/nginx

/etc/nginx/sites-enabled/proxmox
this file should be called instead: /etc/nginx/conf.d/proxmox.conf

/etc/nginx/sites-enabled directory should be empty (also remove the default conf from there)

in the end run nginx -t to check your configuration syntax as well.

also take a look at the instructions here [0]

[0]: https://pve.proxmox.com/wiki/Web_Interface_Via_Nginx_Proxy
 
  • Like
Reactions: Moayad
Hello @oguz,

of course i have followed the wiki topic. nginx - t was successful. I also do not see any issues why it shouldn't be in "sites-enabled" since the nginx documentation is recommending putting it there? But ill try asap



Bash:
:/etc/network# ls -alR /etc/nginx
/etc/nginx:
total 84
drwxr-xr-x   8 root root  4096 Apr 21 13:13 .
drwxr-xr-x 108 root root 12288 May  5 12:15 ..
drwxr-xr-x   2 root root  4096 Apr 21 12:36 conf.d
-rw-r--r--   1 root root  2412 May 29  2021 default.bak
-rw-r--r--   1 root root  1125 May 29  2021 fastcgi.conf
-rw-r--r--   1 root root  1055 May 29  2021 fastcgi_params
-rw-r--r--   1 root root  2837 May 29  2021 koi-utf
-rw-r--r--   1 root root  2223 May 29  2021 koi-win
-rw-r--r--   1 root root  3957 May 29  2021 mime.types
drwxr-xr-x   2 root root  4096 May 29  2021 modules-available
drwxr-xr-x   2 root root  4096 Apr 28 09:40 modules-enabled
-rw-r--r--   1 root root  1447 May 29  2021 nginx.conf
-rw-r--r--   1 root root   180 May 29  2021 proxy_params
-rw-r--r--   1 root root   636 May 29  2021 scgi_params
drwxr-xr-x   2 root root  4096 Apr 28 09:06 sites-available
drwxr-xr-x   2 root root  4096 Apr 28 11:06 sites-enabled
drwxr-xr-x   2 root root  4096 Apr 21 12:13 snippets
-rw-r--r--   1 root root   664 May 29  2021 uwsgi_params
-rw-r--r--   1 root root  3071 May 29  2021 win-utf

/etc/nginx/conf.d:
total 8
drwxr-xr-x 2 root root 4096 Apr 21 12:36 .
drwxr-xr-x 8 root root 4096 Apr 21 13:13 ..

/etc/nginx/modules-available:
total 8
drwxr-xr-x 2 root root 4096 May 29  2021 .
drwxr-xr-x 8 root root 4096 Apr 21 13:13 ..

/etc/nginx/modules-enabled:
total 16
drwxr-xr-x 2 root root 4096 Apr 28 09:40 .
drwxr-xr-x 8 root root 4096 Apr 21 13:13 ..
lrwxrwxrwx 1 root root   54 Apr 21 12:13 50-mod-http-geoip.conf -> /usr/share/nginx/modules-available/mod-http-geoip.conf
lrwxrwxrwx 1 root root   61 Apr 21 12:13 50-mod-http-image-filter.conf -> /usr/share/nginx/modules-available/mod-http-image-filter.conf
lrwxrwxrwx 1 root root   60 Apr 21 12:13 50-mod-http-xslt-filter.conf -> /usr/share/nginx/modules-available/mod-http-xslt-filter.conf
lrwxrwxrwx 1 root root   48 Apr 21 12:13 50-mod-mail.conf -> /usr/share/nginx/modules-available/mod-mail.conf
lrwxrwxrwx 1 root root   50 Apr 21 12:13 50-mod-stream.conf -> /usr/share/nginx/modules-available/mod-stream.conf
lrwxrwxrwx 1 root root   56 Apr 21 12:13 70-mod-stream-geoip.conf -> /usr/share/nginx/modules-available/mod-stream-geoip.conf

/etc/nginx/sites-available:
total 16
drwxr-xr-x 2 root root 4096 Apr 28 09:06 .
drwxr-xr-x 8 root root 4096 Apr 21 13:13 ..
-rw-r--r-- 1 root root 2412 Apr 21 13:06 default
-rw-r--r-- 1 root root  996 Apr 28 11:06 proxmox.conf

/etc/nginx/sites-enabled:
total 8
drwxr-xr-x 2 root root 4096 Apr 28 11:06 .
drwxr-xr-x 8 root root 4096 Apr 21 13:13 ..
lrwxrwxrwx 1 root root   39 Apr 28 09:04 proxmox -> /etc/nginx/sites-available/proxmox.conf

/etc/nginx/snippets:
total 16
drwxr-xr-x 2 root root 4096 Apr 21 12:13 .
drwxr-xr-x 8 root root 4096 Apr 21 13:13 ..
-rw-r--r-- 1 root root  423 May 29  2021 fastcgi-php.conf
-rw-r--r-- 1 root root  217 May 29  2021 snakeoil.conf
 
it should look more like this:

Code:
/etc/nginx:
total 72
drwxr-xr-x  8 root root 4096 Sep 30  2021 .
drwxr-xr-x 90 root root 4096 May  5 12:11 ..
drwxr-xr-x  2 root root 4096 May  5 12:07 conf.d
-rw-r--r--  1 root root 1125 May 29  2021 fastcgi.conf
-rw-r--r--  1 root root 1055 May 29  2021 fastcgi_params
-rw-r--r--  1 root root 2837 May 29  2021 koi-utf
-rw-r--r--  1 root root 2223 May 29  2021 koi-win
-rw-r--r--  1 root root 3957 May 29  2021 mime.types
drwxr-xr-x  2 root root 4096 May 29  2021 modules-available
drwxr-xr-x  2 root root 4096 Sep 30  2021 modules-enabled
-rw-r--r--  1 root root 1447 May 29  2021 nginx.conf
-rw-r--r--  1 root root  180 May 29  2021 proxy_params
-rw-r--r--  1 root root  636 May 29  2021 scgi_params
drwxr-xr-x  2 root root 4096 Sep 30  2021 sites-available
drwxr-xr-x  2 root root 4096 Sep 30  2021 sites-enabled
drwxr-xr-x  2 root root 4096 Sep 30  2021 snippets
-rw-r--r--  1 root root  664 May 29  2021 uwsgi_params
-rw-r--r--  1 root root 3071 May 29  2021 win-utf

/etc/nginx/conf.d:
total 16
drwxr-xr-x 2 root root 4096 May  5 12:07 .
drwxr-xr-x 8 root root 4096 Sep 30  2021 ..
-rw-r--r-- 1 root root  711 May  5 12:07 proxmox.conf

/etc/nginx/modules-available:
total 8
drwxr-xr-x 2 root root 4096 May 29  2021 .
drwxr-xr-x 8 root root 4096 Sep 30  2021 ..

/etc/nginx/modules-enabled:
total 16
drwxr-xr-x 2 root root 4096 Sep 30  2021 .
drwxr-xr-x 8 root root 4096 Sep 30  2021 ..
lrwxrwxrwx 1 root root   54 Sep 30  2021 50-mod-http-geoip.conf -> /usr/share/nginx/modules-available/mod-http-geoip.conf
lrwxrwxrwx 1 root root   61 Sep 30  2021 50-mod-http-image-filter.conf -> /usr/share/nginx/modules-available/mod-http-image-filter.conf
lrwxrwxrwx 1 root root   60 Sep 30  2021 50-mod-http-xslt-filter.conf -> /usr/share/nginx/modules-available/mod-http-xslt-filter.conf
lrwxrwxrwx 1 root root   48 Sep 30  2021 50-mod-mail.conf -> /usr/share/nginx/modules-available/mod-mail.conf
lrwxrwxrwx 1 root root   50 Sep 30  2021 50-mod-stream.conf -> /usr/share/nginx/modules-available/mod-stream.conf
lrwxrwxrwx 1 root root   56 Sep 30  2021 70-mod-stream-geoip.conf -> /usr/share/nginx/modules-available/mod-stream-geoip.conf

/etc/nginx/sites-available:
total 12
drwxr-xr-x 2 root root 4096 Sep 30  2021 .
drwxr-xr-x 8 root root 4096 Sep 30  2021 ..
-rw-r--r-- 1 root root 2412 May 29  2021 default

/etc/nginx/sites-enabled:
total 8
drwxr-xr-x 2 root root 4096 Sep 30  2021 .
drwxr-xr-x 8 root root 4096 Sep 30  2021 ..

/etc/nginx/snippets:
total 16
drwxr-xr-x 2 root root 4096 Sep 30  2021 .
drwxr-xr-x 8 root root 4096 Sep 30  2021 ..
-rw-r--r-- 1 root root  423 May 29  2021 fastcgi-php.conf
-rw-r--r-- 1 root root  217 May 29  2021 snakeoil.conf
 
Hello,

a reboot for the proxmox system works wonder... It is working now again :)
have you changed the config at all? or just did a reboot?

nevertheless you can explain your solution and mark the thread as [SOLVED] so others with the same issue can benefit as well ;)
 
I rebooted the node before i changed the config and it seemed to work fine. Nonetheless, i changed the file structure as you suggested and it still is working.

Maybe there has been other issues. Is there a logfile for the pve-gui?
 
I rebooted the node before i changed the config and it seemed to work fine. Nonetheless, i changed the file structure as you suggested and it still is working.
maybe you just had to restart the nginx service, though i'm not sure ^^
thanks for explaining :)
Maybe there has been other issues. Is there a logfile for the pve-gui?
yeah, you can take a look at /var/log/pveproxy/access.log and the system journals (journalctl)

edit: might make sense to take a look at nginx logs as well ;)
 
Last edited: