0

What I'm trying to do is server a static website (example.com) and also use the same domain and the server to proxy a game server backend (example.com/game-server).

This is my configuration, but neither the static page nor the game server appears to be working.

server {
    server_name example.com

    location /game-server {
            proxy_pass http://localhost:7350/;
            proxy_buffering off;
            proxy_set_header X-Real-IP $remote_addr;
    }

    location / {
            root /var/www/example.com;
            index index.html;
            try_files $uri $uri/ =404;
    }
}

The problem I'm having is that both work with "location /", but I'm getting 404 if I change it to something else.

I've tried:

"location /game/"
"location /game"
"location /website"
"location /website/" 

etc, none of them work.

Irakli C.
  • 9
  • 1
  • What is the problem you are having? – Michael Hampton Sep 05 '19 at 07:14
  • The game-server location possibly needs a trailing slash and some other proxy directives (or not, don't know anything about the server), the static location should be working, what's the error? – Lenniey Sep 05 '19 at 07:14
  • The problem I'm having is that both work with "location /", but I'm getting 404 if I change the location to something else. – Irakli C. Sep 05 '19 at 10:46

0 Answers0