nginx reverse proxy for vibe tutorial
James Miller
james at aatch.net
Sun May 6 15:42:19 PDT 2012
On Sunday, 6 May 2012 at 22:32:16 UTC, James Miller wrote:
>
> I thought it should work, and I'm probably missing something,
> but here:
>
> nginx: [emerg] "proxy_pass" cannot have URI part in location
> given by regular expression, or inside named location, or
> inside "if" statement, or inside "limit_except" block in
> /etc/nginx/conf/nginx.conf:87
> nginx: configuration file /etc/nginx/conf/nginx.conf test failed
>
> Thats what I get at the "Checking configuration stage".
>
> For the record, using a named section works perfectly for my
> php configuration section, so I'm wondering if its something to
> with proxy_pass?
>
> --
> James Miller
Well a bit of googling reveals this annoying problem:
using `proxy_pass http://localhost:8080/;` is an error, where
using `proxy_pass http://localhost:8080;` is fine.
I think FUUUUUUUUUU is the most appropriate sentiment here.
For the record: the most recent, working, version of the
configuration is. Its also more flexible and secure, which is
nice.
server {
listen 80;
server_name vibe.mysite.com;
location / {
root /path/to/statics;
try_files $uri @vibe;
}
location @vibe {
proxy_pass http://localhost:8080;
proxy_redirect off;
proxy_pass_request_body on;
proxy_http_version 1.1;
proxy_set_body $request_body;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
More information about the Digitalmars-d
mailing list