3

I've been banging my head against this for awhile now. I have an archiva repository server I'm trying to proxy through nginx with ssl offloading. archiva has a jetty server built in that is listening on port 8008 of the localhost. I'm able to get to the archiva server through the proxy, but it wants to return http responses and not https responses. I thought that setting the following headers was supposed to tell the server to respond with https:

            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header        X-Forwarded-Proto https;
        proxy_redirect     off;

I also tried "proxy_redirect default;". It seems that the jetty/archiva server is not recognizing these or there needs to be something more. I've been scouring forums and as far as I can tell, everything is set as it should be. I'm not sure where else to check at this point. Has anyone had any success with this?

3
  • At the moment, I have a workaround that I'm not proud of. In nginx.conf I added a rewrite to port 80: server {... location / {... rewrite ^ https://$host$request_uri? permanent;
    – numb3rs1x
    Sep 25, 2013 at 20:38
  • can you please post your server-config? Sep 26, 2013 at 8:46
  • I'm still getting tripped up by Redback's CSRF check, since protocols don't match. Jun 5, 2018 at 17:37

1 Answer 1

1
    upstream archiva.example.com {
            server 127.0.0.1:8084;
}

# Serve Local Webserver Out of Proxy
server {
    listen      80;
    server_name archiva.example.com;
    rewrite     ^(.*)   https://$server_name$1 permanent;
}

server {

    listen                  443;
    ssl                     on;
    ssl_certificate .....
server_name  you.example.com;

   location / {
       proxy_pass       http://127.0.0.1:8084;
       proxy_set_header         host archiva.example.com;
   }
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .