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

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.

| improve this answer | |
  • That did work but with one caveat. When the redirect happens I get a url like: 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 7: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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.