WordPress.org

Ready to get started?Download WordPress

Forums

Redirect loop error for WP page (1 post)

  1. protiendat
    Member
    Posted 7 months ago #

    Hello Experts,

    I installed NGINX and Apache in my Ubuntu Server which Nginx is front end proxy. After that, I install WordPress on the server block with domain name riviuhost.com. But can not reach the index page as it appeared redirect loop notification on the browser. In other hand, I create a info.php file put at the root folder this server block and other manual created html files still read as normal and also can log in to admin page and go through all the function tabs of admin dashboard.

    Followings are my configuration file:

    1.File: /etc/nginx/sites-available/riviuhost.com:

    [ Moderator note: please wrap code in backticks or use the code button. ]

    server {
    listen 80;
    
    root /var/www/riviuhost.com/public_html;
    index index.php index.html index.htm;
    
    server_name riviuhost.com www.riviuhost.com;
    
    location / {
    try_files $uri $uri/ /index.php;
    }
    error_page 404 /404.html;
    
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root /var/www/riviuhost.com/public_html;
    }
    location ~ \.php$ { 
    
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $host;
    proxy_pass http://127.0.0.1:8080;
    
    }
    location ~ /\.ht {
    deny all;
    }
    }

    2.File /etc/nginx/nginx.conf:

    user www-data; #change to the same user apache runs as
    worker_processes 1; #change to the number of your CPUs/Cores
    worker_rlimit_nofile 8192;
    
    error_log /var/log/nginx/error.log;
    pid /var/run/nginx.pid;
    
    events {
    worker_connections 1024;
    use epoll;
    accept_mutex off;
    }
    
    http {
    server_names_hash_bucket_size 64;
    types_hash_max_size 2048;
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    access_log /var/log/nginx/access.log;
    sendfile on;
    tcp_nopush on;
    keepalive_timeout 65;
    
    # reverse proxy options
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    
    # gzip compression options
    gzip on;
    gzip_http_version 1.0;
    gzip_comp_level 6;
    gzip_min_length 0;
    gzip_buffers 16 8k;
    gzip_proxied any;
    gzip_types text/plain text/css text/xml text/javascript application/xml application/xml+rss application/javascript application/json;
    gzip_disable "MSIE [1-6]\.";
    gzip_vary on;
    
    # include virtual hosts configuration
    include /etc/nginx/virtual.d/*.conf;
    include /etc/nginx/sites-enabled/*;
    }

    3.file /etc/apache2/ports.conf

    NameVirtualHost 127.0.0.1:8080
    Listen 127.0.0.1:8080
    NameVirtualHost 127.0.0.1:8081
    Listen 127.0.0.1:8081

    4.File /etc/apache2/sites-available/riviuhost.com:

    <VirtualHost 127.0.0.1:8080>
    ServerAdmin webmaster@localhost
    ServerName riviuhost.com
    ServerAlias www.riviuhost.com
    DocumentRoot /var/www/riviuhost.com/public_html
    <Directory />
    Options FollowSymLinks
    AllowOverride All
    </Directory>
    <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>
    
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    </Directory>
    
    ErrorLog ${APACHE_LOG_DIR}/error.log
    
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
    
    </VirtualHost>

    Could anyone please help me on this issue. I also concerned about htaccess file so I deleted it but it stll remains the same issue.

    Thanks and regards,
    Dat

Reply

You must log in to post.

About this Topic