DEgITx / rats-search

BitTorrent P2P multi-platform search engine for Desktop and Web servers with integrated torrent client.
MIT License
1.62k stars 176 forks source link

Using nginx's proxy_pass to access via domain name will display a blank page #89

Closed monkey000 closed 5 years ago

monkey000 commented 5 years ago

Using nginx's proxy_pass to access via domain name will display a blank page. But through the ip: port access can display the normal page. I don't know why there is such a problem. Can anyone provide me some help?

This is my nginx config:

server {
    listen 80;
    server_name docs.biubiubiu.dev;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443;
    server_name docs.biubiubiu.dev;
    ssl on;
    ssl_certificate  /etc/nginx/cert/1_docs.biubiubiu.dev_bundle.crt;
    ssl_certificate_key /etc/nginx/cert/2_docs.biubiubiu.dev.key;
    ssl_session_timeout 10m;
    ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

    proxy_set_header X-Forwarded-For $remote_addr;

    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
    server_tokens off;

    location / {
        proxy_pass         http://127.0.0.1:8095;
        proxy_redirect off;
        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-Host $server_name;
        proxy_set_header   X-Forwarded-Proto https;

        access_log      /var/log/nginx/seahub.access.log;
        error_log       /var/log/nginx/seahub.error.log;

        proxy_read_timeout  50000s;

        client_max_body_size 0;
    }

}
DEgITx commented 5 years ago
server {
     listen 8080;
 location / {
        proxy_pass         http://127.0.0.1:8095;
        proxy_redirect off;
        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-Host $server_name;
        proxy_set_header   X-Forwarded-Proto https;

        proxy_read_timeout  50000s;

        client_max_body_size 0;
 }
}

I tried the basic configuration without ssl and it works for me on 8080 port for example

zella commented 5 years ago

Same problem with white screen. I try run it in container with open vpn https://github.com/dperson/openvpn-client To access I need use proxy. -w "http://rats:8095/;/ratsearch -w "http://rats:8095/main.js;/main.js" So I should able to access application on http://localhost/ratsearch And it's not working, I see white screen.

upd

Seems like cors issue:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8095/socket.io/?EIO=3&transport=polling&t=MgoSDGl