skip to Main Content

I run a Java-Server behind a NGINX proxy. I use a Java Server Socket extansion, but this don´t change the working. I use the proxy because i want to join the server via a domain. If i use the normal ip-adress from my server everything work fine, but if i want to use the domain it gives me errors. I think the problem is the configuration of nginx.

proxy_set_header Upgrade  $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;

this are some settings i tried but it don´t work. I found in different sources these commands.

super("subdomain.domain.de", 80, 5000, false, false, "login", "test");

this is my Constructor for the Client. nginx listens in port 80 and root to 8181.

java.io.StreamCorruptedException: invalid stream header: 48545450

This is the error i got on the client.

Maybe somebody know, how to configure nginx that this work.

What settings do i need and where to store/ add.

2

Answers


  1. Chosen as BEST ANSWER

    I installed nginx with docker and it works fine. I host a nextcloud and a website and there everything is fine. It just not work with a java server. I only used the web-GUI, maybe there is a problem, i don't know.


  2. The config part is from the location block I guess. Did you configure server block correctly? Did you specify your domain in the server block? If you share more detail about you nginx configuration, we can help better.

    Additionally, If you search it on google as nginx reverse proxy configuration, you can find pretty good examples and boilerplate configs.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search