0

I have a owncloud server running at owncloud.example.com/owncloud Its a bitnami install and requires me to access it via the /owncloud path. I have the thing reverse proxied through nginx but it takes me to the bitnami page first from which I have to take a link to the actual path. Or I have to access the url via the complete path. How do I setup my reverse proxy to avoid this. This is my rudimentary setup to just play around with.

server {
    listen   80;
    server_name owncloud.example.com;


    location / {

    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $host;
    proxy_pass http://192.168.1.139:83/;

 }

}

Right now the reverse proxy will take me to owncloud.example.com. I need it to take me to owncloud.example without hitting a redirect loop.

1 Answers1

1

Change you proxy_pass to following:

proxy_pass http://192.168.1.139:83/owncloud;

It should do the trick. If that's not what you want please describe more carefully.

Navern
  • 1,569
  • 1
  • 9
  • 14
  • That did work but with one caveat. When the redirect happens I get a url like: http://owncloud.example.com:83/owncloud. Any way to remove the port? I tried a proxy_redirect but leads to a too many redirects error. – Dikshant Adhikari Aug 16 '15 at 07:08
  • It's strange that port is changed. It shouldn't be that way:) Could you please provide curl -L -I info? – Navern Aug 16 '15 at 10:19