Forum Discussion

ispy_344504's avatar
ispy_344504
Icon for Nimbostratus rankNimbostratus
Feb 12, 2018

http to https not working with nginx

Hi,

I have a problem about F5 iRule, i set the irule on F5 "

when_HTTP_REQUEST {
HTTP::host [HTTP::host]:443;
}
" and it's working perfectly.

but when i changed my database from apache to nginx, https is not working. we run nginx as load balance before and set

proxy_set_header Host $host:443;
, it worked well.

Could anyone give me any suggestions, please?

15 Replies

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    Remove that irule from the virtual server, and let us know what exactly was not working when you accessed it. Any error messages?

     

  • Hi Jie, We've tried to remove irules before, and https web only shows 1 picture, it was the same problem as before that we don't insert host:443.

     

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    Did you mean you have the same output page on your screen with or without the irule?

     

    Without a clear description of what the problem is, we can only make guesses at what is not working.

     

  • Hi Jie,

     

    Sorry, If our web service on the nginx, http web page is normal and it showed login page, but the https web page only showed one picture.

     

    if our web service on the Apache, we set the irules on the https, and it works fine, it'll show login page as same as http page.

     

    Before we use F5 LB, we used nginx LB instead, it has the same problem, but when we set "proxy_set_header Host $host:443" on the nginx, it solved the problem. is there any similar setting on F5? or can we use irules?

     

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    I suspect that your application needs to be aware which scheme (HTTP or HTTPS) is used by the user to access it. You can try the following:

     

    Edit the F5 virtual server's HTTP profile:

     

    • For the field of "Request Header Insert", add "X-Forwarded-Proto: https" (no quotes);
    • For the field of "Redirect Rewrite", select "All"

    and see how that goes.

     

    What application software is it, Weblogic, PHP, etc?