Nginx reverse proxy regex location

Viewed 59

I have a website (let's say www.example.com) with an input parameter to type 6 character code to join a socket.io room. If you to go www.example.com, it will show you the empty input but if you go to www.example.com/ABCDEF it will automatically pre-fill the input with the code 'ABCDEF'. The rooms codes are all like [a-zA-Z]{6}. I have difficulty to configure correctly my nginx reverse proxy, It works fine when you go to www.example.com but I have a 404 error when I go to www.example.com/ABCDEF. Here is my nginx config :

 server {

    root /var/www/example.com/html;
    index index.html index.htm index.nginx-debian.html;

    server_name example.com www.example.com;



location / {

            try_files $uri $uri/ =404;
    }
}

I also tried this :

location ~* "/[a-zA-Z]{6}" {

           try_files $uri $uri/ =404;
 }
0 Answers
Related