How to use Proxy Directive

Discussion in 'General' started by Zapod, Oct 23, 2019.

  1. Zapod

    Zapod New Member

    Hi everyone,
    please don't mind, I'm new into ISPConfig. I've searched a lot but didn't find a solution.

    How can I use the "proxy_pass_header Authorization" possibility in the Proxy Directive?
    I want to set up a proxy redirect with a simple user/password context, before redirecting.

    I'm using ISPConfig 3.1 with nginx.

    Thanks for your help,
  2. Steini86

    Steini86 Active Member

    As far as I know, this in not implemented directly.
    In ISPconfig, Sites -> Your Website -> Options, you can paste all the options you need in the nginx directive.
  3. Zapod

    Zapod New Member

    Thanks for your answer, Steini86,
    but my question was "How", not "Wehre".

    What I try to figure out is: what do I have to type in the Proxy-Directive Field, to get a username/password request, before the transparent proxy will show the target.
  4. Steini86

    Steini86 Active Member

    "proxy_pass_header Authorization" is used to pass an authorization header via the proxy from the service to the user. If I got this correctly:
    then your service does not have an authorization, but you want to add one before the proxying happens?

    Haven't tried it, but just set a password protected folder to / and then a proxy pass from / to your service?
  5. Zapod

    Zapod New Member

    Hi Steini86,
    I think you got it correctly.
    Don't know if that works but I'll give it a try if you or (someone else) can tell me how I "set a password protected folder to/"
    With apache I can use the .htpasswd files but I'm using nginx.
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to use the folder protection feature in the sites module in ISPConfig.
  7. Zapod

    Zapod New Member

    Hi and thank you for your replies,

    it didn't work so far. Here is what I've tried:

    I used the folder protection feature to set a username and password to /
    then I wrote the following in the proxy-directive:
    location / {
     proxy_pass http://some.domain.tld/;
     proxy_set_header X-Real-IP  $remote_addr;
     proxy_set_header X-Forwarded-For $remote_addr;
     proxy_set_header Host $host;
     proxy_buffering off;
    and also tried also to just set the line "proxy_pass_header Authorization;" without the other stuff in the proxy-directives (without "location / {", etc), but there's no difference.

    Any suggestions?
  8. Steini86

    Steini86 Active Member

    Do you get a useful log entry? I have no nginx to try, but in my understanding it should work.
    What exactly "did not work"? Error message?

Share This Page