Running server behind reverse proxy causes OPTIONS on /v1/projects

I have a fairly clean install, just ran a basic docker run -d --restart=always -p 8080:8080 rancher/server

I can get to it directly, but not through an nginx proxy. The first set of requests is clean, but suddenly it tries to do an OPTIONS to /v1/projects.

The (sanitized) nginx logs are below:

"GET /static HTTP/1.1" 200 382 
"GET /v1/token HTTP/1.1" 200 229 "http://x.x.x.x:8080/static/" 
"GET /v1/schemas?limit=1000 HTTP/1.1" 200 18654 "http://x.x.x.x:8080/static/"
"OPTIONS /v1/projects?all=true&limit=1000 HTTP/1.1" 405 172 "http://x.x.x.x:8080/static/"

So it loads /static, which loads /v1/token and /v1/schemas and then tries to call OPTIONS on /v1/projects.

Looking at it client-side, Firebug gives the same thing up to a point.

GET static
GET vendor.css
GET ss-gizmo.css
GET css?family=...
GET ui.css
GET vendor.js
GET ui.js
GET token
GET schemas?limit=1000

and here is where they diverge. Next line direct is:

GET projects?all=true...

While via the proxy:

OPTIONS projects?all=true

As if it is trying to do CORS… which I think it is. The successful case (direct) uses the same IP and port for the GET projects, but the proxy tries the same IP without the port.

I had the same problem when I tried to get via the proxy to http://x.x.x.x:8080/ where it redirected to http://x.x.x.x/static

When going direct, it stayed with the port http://x.x.x.x:8080/ to http://x.x.x.x:8080/static

@deitch I’ve responded to your github coment. Let’s move the conversation to there
https://github.com/rancher/rancher/issues/719#issuecomment-125991520

Yep, I saw that only after I posted here. :slight_smile:

Gotcha, just wanted to let you know where to look for my reply.