Im trying to setup a proxy on a subdir but cant make it work...
I want to proxy all requests in a subdir to another port
eg
http://domain.com/websocket/test.php => http://domain.com:8080/websocket/test.php
But cant make it work.. I have now tried to return 404 if a path matching /websocket is requested.. But that wont work either
What am I missing here?!
PHP files are executed as they should..
file structure
/test.php
/websocket/server.php
/websocket/test.php
All URL's are requested without problems, but /websocket/server.php and /websocket/test.php should return 404 (look in the nginx conf)
nginx
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include /var/ini/nginx/fastcgi.conf;
fastcgi_pass php;
fastcgi_index index.php;
}
location /websocket {
return 404;
proxy_pass http://localhost:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}