Help - Nginx Azure Auth

Pavan P pavan45 at gmail.com
Thu Nov 26 04:27:19 UTC 2020


Hi Harish,
Below is the config of my nginx. Https module is configured fine. Please
let me know if I have missed anything.

server {
    server_name ci1.altlifelab.com;

    location / {
      proxy_set_header        Host $host:$server_port;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-Proto $scheme;


      # Fix the "It appears that your reverse proxy set up is broken" error.
      proxy_pass          http://127.0.0.1:9080;
      proxy_read_timeout  90;

      proxy_redirect      http://127.0.0.1:9080
http://www.ci1.altlifelab.com;

      # Required for new HTTP-based CLI
      proxy_http_version 1.1;
      proxy_request_buffering off;
      # workaround for https://issues.jenkins-ci1.org/browse/JENKINS-45651
      add_header 'X-SSH-Endpoint' 'ci1.altlifelab.com:50022' always;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/ci1.altlifelab.com/fullchain.pem;
# managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/ci1.altlifelab.com/privkey.pem;
# managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}

server {
    if ($host = ci1.altlifelab.com) {
#        return 301 https://$host$request_uri;
return 301
https://myapps.microsoft.com/signin/ci2/a825dd26-fed2-4423-ae69-6a7d457b4b44?tenantId=eb9970cc-4803-4f6a-9ad2-e9b46042c5fd
;
    } # managed by Certbot


    listen 80;
server_name ci1.altlifelab.com;
return 301
https://myapps.microsoft.com/signin/ci2/a825dd26-fed2-4423-ae69-6a7d457b4b44?tenantId=eb9970cc-4803-4f6a-9ad2-e9b46042c5fd;

}

On Thu, Nov 26, 2020 at 5:04 AM HARISH KUMAR Ivaturi <
harishkumarivaturi at gmail.com> wrote:

> I am not sure if you have configured nginx with https_module. Once try
> that. And also add proper headers in the nginx.conf like
>
> Listen 443 ssl;
> Certificates location
>
> BR
> Harish Kumar
>
> On Wed 25 Nov, 2020, 3:53 PM Pavan P, <pavan45 at gmail.com> wrote:
>
>> Hi,
>> I have configured nginx to authenticate with azure AD for login.
>>
>> When I access the site abc.example.com it redirects to Azure for
>> authentication and redirects me back once the authentication is complete.
>>
>> How ever when I try to access the site with https abc.example.com it
>> does not redirect for authentication.
>>
>> Is there anyway I can get both http and https to redirect for azure auth.
>>
>> Regards,
>> Pavan
>>
>> _______________________________________________
>> nginx-devel mailing list
>> nginx-devel at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20201126/3bdfdb1d/attachment-0001.htm>


More information about the nginx-devel mailing list