Giter Site home page Giter Site logo

502 Bad Gateway about openseedbox HOT 7 CLOSED

openseedbox avatar openseedbox commented on May 29, 2024
502 Bad Gateway

from openseedbox.

Comments (7)

erindru avatar erindru commented on May 29, 2024

The provided nginx config is just a "intended case" example, eg it has SSL enabled by default and it can support downloading files as .zip. Unfortunately, this relies on you compiling a custom version of nginx with the mod_zip and headers_more module (see the "Compiling NGINX" section of the readme).

The "easy case" config is one that removes any lines related to SSL, and the "more_clear_headers" line. You'll also need to change the "server_name" line to match your actual server name.

Can you please post the config you are using?

from openseedbox.

dausruddin avatar dausruddin commented on May 29, 2024

Yes I compiled the nginx with mod_zip and headers_more module.
I never use nginx before. So, excuse me for any silly mistakes I made.

events {
  worker_connections  4096;  ## Default: 1024
}

 http {
    server_tokens off;
    add_header X-Frame-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";

server {
  listen 80;
  server_name domain.com;

    gzip on;
    gzip_types "text/plain" "text/xml" "application/json";
    gzip_comp_level 9;

    location / {
        proxy_pass http://127.0.0.1:9000;
        proxy_set_header Host $http_host:$http_port;
    }

    location ~* ^/rdr/(.*?)/(.*) {
        internal;
        resolver 8.8.8.8;
        proxy_set_header Host $1;
        proxy_max_temp_file_size 0;
        proxy_pass $scheme://$1/$2?$args;
        more_clear_headers "Set-Cookie" "X-Archive-Files";
    }
}

}

from openseedbox.

dausruddin avatar dausruddin commented on May 29, 2024

I messed up with the config..
http://domain.com will redirect to https://domain.com and will ended with problem loading page.
but,
http://domain.com:9000 will open the seedbox webpage.

events {
  worker_connections  4096;  ## Default: 1024
}

 http {
    server_tokens off;
    add_header X-Frame-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";

server {
  listen 80;
  server_name domain.com;

    gzip on;
    gzip_types "text/plain" "text/xml" "application/json";
    gzip_comp_level 9;

    location / {
        proxy_pass http://domain.com:9000;
    }
}

}

from openseedbox.

dausruddin avatar dausruddin commented on May 29, 2024

Somehow, curl http://127.0.0.1:9000 did not return any result.
Also tried with http://domain.com:9000 still didn't return any result

from openseedbox.

dausruddin avatar dausruddin commented on May 29, 2024

It appears that my domain was the problem.
I successfully run nginx for reversing the proxy with this config.
Can you look at it if there are any I need to add up

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    gzip  on;
    gzip_types "text/plain" "text/xml" "application/json";
    gzip_comp_level 9;

    server {
        listen       80;
        server_name  seedbox.domain.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
                proxy_pass http://127.0.0.1:9000;
#            root   html;
#            index  index.html index.htm;
        }

location ~* ^/rdr/(.*?)/(.*) {
                internal;
                resolver 8.8.8.8;
                proxy_set_header Host $1;
                proxy_max_temp_file_size 0;
                proxy_pass $scheme://$1/$2?$args;
                more_clear_headers "Set-Cookie" "X-Archive-Files";
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443;
    #    server_name  localhost;

    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_timeout  5m;

    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers   on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

from openseedbox.

erindru avatar erindru commented on May 29, 2024

Yep looks good to me

Your issue was still trying to use port 9000 - thats the port Play! is listening on, and nginx is proxying to. To hit the nginx reverse proxy, you need to use port 80 since thats what nginx is listening on (due to the listen 80 in the server block).

from openseedbox.

dausruddin avatar dausruddin commented on May 29, 2024

The lines you use in port 443 part, is it a mandatory to be placed in port 80 if im going to use http?
You have gzip, more clear header, host, etc. Do i need to cut them and paste into port 80 section?

from openseedbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.