M
M
Marcel Markhabulin2011-06-20 11:04:52
Nginx
Marcel Markhabulin, 2011-06-20 11:04:52

nginx + some webserver

Given:
nginx (example.com:80 - accessible from outside), SomeWebServer (localhost:8080 - accessible only from localhost)

Task:
Make access to localhost:8080 upon request: example.com/some/
I reviewed many articles, including the Sysoev documentation, but did not find an answer to such a simple, at first glance, question.

End task:

  1. User visits example.com
  2. I wanted to enter a different section of example.com/some/.
  3. He gets out BasicHttpAuthorization
  4. Upon successful authorization, nginx gives it a page from localhost:8080 (now SomeWebServer gives 404, because localhost:8080/some/ does not exist)
  5. Further works inside example.com/some/many/folders/and/files , getting all folders from localhost.

Current nginx config:

server {
listen 80 default;
server_name example.com;

location / {
root /var/www;
index index.php;
}

location /some {
proxy_pass 127.0.0.1:8080;
}
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2011-06-20
@milar

so you put a slash =)
location /some/ {
proxy_pass 127.0.0.1:8080/;
}
and everything will work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question