0xJacky / nginx-ui

Yet another WebUI for Nginx
https://nginxui.com
GNU Affero General Public License v3.0
5.42k stars 387 forks source link

Stuck at `Getting the certificate, please wait...` #704

Open FluffyDiscord opened 6 days ago

FluffyDiscord commented 6 days ago

Describe the bug Nginx UI fails to send request to create SSL certificate if its run from Firefox.

To Reproduce Steps to reproduce the behavior:

  1. Create new site with custom config
  2. Switch back from Advanced to Basic view
  3. Try generating SSL certificate
  4. Windows pops up and it gets stuck

Expected behavior Certificate creates normally

Screenshots image

Info (please complete the following information):

Additional context Works using Chrome.

0xJacky commented 6 days ago

Hi @FluffyDiscord, did you run Nginx UI behind a reverse proxy?

0xJacky commented 6 days ago

If so, please modify the configuration file to allow Nginx to handle WebSocket requests for Nginx UI.

server {
    listen          80;
    listen          [::]:80;

    server_name     <your_server_name>;
    rewrite ^(.*)$  https://$host$1 permanent;
}

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    listen  443       ssl;
    listen  [::]:443  ssl;
    http2   on;

    server_name         <your_server_name>;

    ssl_certificate     /path/to/ssl_cert;
    ssl_certificate_key /path/to/ssl_cert_key;

    location / {
        proxy_set_header    Host                $host;
        proxy_set_header    X-Real-IP           $remote_addr;
        proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
        proxy_set_header    X-Forwarded-Proto   $scheme;
        proxy_http_version  1.1;
        proxy_set_header    Upgrade             $http_upgrade;
        proxy_set_header    Connection          $connection_upgrade;
        proxy_pass          http://127.0.0.1:9000/;
    }
}
FluffyDiscord commented 6 days ago

No, it's not run behind reverse proxy. Also I noticed that the error I sent in screenshot happens also on Chrome, but at random. Refreshing page helps.

Hintay commented 4 days ago

Hello, can you provide the running logs of the nginx ui at the time of this issue?

FluffyDiscord commented 4 days ago

Hi, there is nothing to send. It's a cors issue as mentioned before. You can see the only error on the screenshot. The request was blocked by browser apparently, so nginx doesn't even see it