This webpage has a redirect loop (ERR_TOO_MANY_REDIRECTS) nginx-forum at
Mon Mar 7 19:23:34 UTC 2016


My set up is as below:

NGINX (reverse proxy) IBM WebSeal (redirects to a common login page, after
authentication forwards to internal proxy along with the redirected url) 
Internal Proxy (IBM http Server)  WebSphere Portal.

I am trying to access

Host_name is the server_name on NGINX and the url is in the Portal server.
When I am accessing it directly, replacing the host_name with Portal server
IP/port, it works.

With the host_name, I am getting the message as in the subject line, on the

My nginx config is below:-

    server_tokens off; #Turn off version number
    add_header X-Frame-Options "SAMEORIGIN"; #Turn off click jacking; so no
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options nosniff;

# Redirect all insecure requests to the secure port
server {
  listen <IP_address>:80 ;
  server_name <server name>;
   return 301 https://<server_name>$request_uri;

# Serve SSL encrypted data
server {
  listen <IP_address>:443 default_server ssl;
  add_header Strict-Transport-Security max-age=15768000;
  server_name <server_name>;

  access_log /web/nginx/servers/name/logs/access.log;
  error_log /web/nginx/servers/name/logs/ error.log;

  # Security
    ssl on;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;


  # Specify the certificate and key
    ssl_certificate /etc/nginx/ssl/name/;
    ssl_certificate_key /etc/nginx/ssl/name/;

location /download/ {
                                                rewrite ^/download/vadxeval$
ADX/Virtual ADX_Eval"  break;
^/download/apitoolkit$ "https:// <server
API Toolkit"  break;

  location / {
        rewrite ^/$ https:// <server name>/wps/myportal/ break;
        rewrite ^/wps/portal$ http:// <server name>/wps/myportal/ break;

        index index.html;
        root /web/nginx/servers/name/conf;
    proxy_set_header        Host $server_name;
    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;

    proxy_pass http://<webseal_hostname>/;
    proxy_read_timeout 90;

Please help.


Posted at Nginx Forum:,265136,265136#msg-265136

More information about the nginx mailing list