PWM behind NGinx Proxy and AWS ALB

467 views
Skip to first unread message

rahimi...@gmail.com

unread,
Jul 18, 2019, 10:36:34 AM7/18/19
to pwm-general
Hi There,
Sorry if this question has been asked before. I couldn't find any solution, I am hoping someone in here could help me. I am trying to deploy PWM in my environment and do so in a secure manner. PWM, Tomcat, and Apache are deployed on a Ubuntu 18.04 machine. I have already configured it and everything works great. Now I would like to put the app behind an Nginx Proxy. The Nginx Proxy server is attached an AWS ALB. Ultimately I would like for this to happen: user hits https://pwm.domain.com, SSL terminates at AWS ALB level then HTTP traffic is forwarded to Nginx Proxy. The Nginx Proxy will then Proxy pass the request to the app server. Currently the app loads by going to URL http://localhost:8080/pwm once the user logs in, it adds the /pwm/private/ and other stuff to the URL. I had no luck to get the PWM to load by simply going to https://pwm.domain.com. My Nginx reverse proxy conf is below. Any help is appreciated.


location / {
rewrite ^ https://pwm.domain.com/pwm/ last;
#proxy_redirect http://10.10.10.24:8080 https://pwm.domain.com;
}

location /pwm {

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;

proxy_max_temp_file_size 0;
proxy_buffering off;
proxy_connect_timeout 30;
proxy_send_timeout 30;
proxy_read_timeout 30;
proxy_redirect http://10.10.10.24:8080 https://pwm.domain.com;
proxy_pass http://10.10.10.24:8080/;

}

Forrest, Rodney

unread,
Jul 18, 2019, 11:31:27 AM7/18/19
to pwm-g...@googlegroups.com
I did the same thing and got it working I will post my nginx when I get in the office. 

--
You received this message because you are subscribed to the Google Groups "pwm-general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pwm-general...@googlegroups.com.
To post to this group, send email to pwm-g...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pwm-general/133241e2-f737-490a-bb59-47b1231ffbd3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rahimi...@gmail.com

unread,
Jul 18, 2019, 1:40:13 PM7/18/19
to pwm-general
On Thursday, July 18, 2019 at 11:31:27 AM UTC-4, Rodney Forrest wrote:
> I did the same thing and got it working I will post my nginx when I get in the office. 
>
>
> On Thu, Jul 18, 2019, 9:36 AM <rahimi...@gmail.com> wrote:
> Hi There,
>
> Sorry if this question has been asked before. I couldn't find any solution, I am hoping someone in here could help me. I am trying to deploy PWM in my environment and do so in a secure manner. PWM, Tomcat, and Apache are deployed on a Ubuntu 18.04 machine. I have already configured it and everything works great. Now I would like to put the app behind an Nginx Proxy. The Nginx Proxy server is attached an AWS ALB. Ultimately I would like for this to happen: user hits https://pwm.domain.com, SSL terminates at AWS ALB level then HTTP traffic is forwarded to Nginx Proxy. The Nginx Proxy will then Proxy pass the request to the app server. Currently the app loads by going to URL http://localhost:8080/pwm once the user logs in, it adds the /pwm/private/ and other stuff to the URL. I had no luck to get the PWM to load by simply going to https://pwm.domain.com. My Nginx reverse proxy conf is below. Any help is appreciated.
>
>
>
>
>
> location / {
>
>                 rewrite ^ https://pwm.domain.com/pwm/ last;
>
>                 #proxy_redirect http://10.10.10.24:8080 https://pwm.domain.com;
>
>         }
>
>
>
>         location /pwm {
>
>
>
>         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>
>         proxy_set_header Host $host;
>
>         proxy_set_header X-Real-IP $remote_addr;
>
>
>
>         proxy_max_temp_file_size 0;
>
>         proxy_buffering off;
>
>         proxy_connect_timeout 30;
>
>         proxy_send_timeout 30;
>
>         proxy_read_timeout 30;
>
>         proxy_redirect http://10.10.10.24:8080 https://pwm.domain.com;
>
>         proxy_pass http://10.10.10.24:8080/;
>
>
>
>         }
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "pwm-general" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to pwm-g...@googlegroups.com.
>
> To post to this group, send email to pwm-g...@googlegroups.com.
>
> To view this discussion on the web visit https://groups.google.com/d/msgid/pwm-general/133241e2-f737-490a-bb59-47b1231ffbd3%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Hi Rodney,
Patiently waiting for that Conf :)

rahimi...@gmail.com

unread,
Jul 18, 2019, 4:23:58 PM7/18/19
to pwm-general
I figured it out.
Reply all
Reply to author
Forward
0 new messages