I've installed tomcat for one website and apache2 for another (wordpress). The problem happens with wordpress website. There is nginx for reverse proxy and here it is:
server {
listen 80;
root /var/www/html/;
index index.php index.html index.htm;
server_name test.example.com;
location / {
try_files $uri $uri/ /index.php;
}
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:8081;
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
server_name conf.example.com;
location / {
proxy_pass http://127.0.0.1:8080;
}
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name batterykazakhstan.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
}
So tomcat works well. But Wordpress is always redirecting to the welcome page in the loop. Could you help with this problem? I read about it and tried the solution suggested by putting to functions.php at top the:
remove_filter('template_redirect', 'redirect_canonical');
But that didnt help..
EDIT1:
The port 8081 is going to tomcat server and opening the test.example.com which is the Wordpress site
The port 8080 going to conf.example.com and opening the tomcat server website which works ok.
EDIT 2: here is the apache config:
ServerAdmin webmaster@localhost DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
EDIT 3:
I've got only two .htaccess files located here:
/var/www/html/wp-content/uploads/wp-clone/.htaccess
with contents:
<Files>
Order allow,deny
Deny from all
Satisfy all
</Files>
And one more here
/var/www/html/wp-content/plugins/akismet/.htaccess
With contents:
<IfModule !mod_authz_core.c>
Order Deny,Allow
Deny from all
</IfModule>
# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Akismet CSS and JS
<FilesMatch "^(form\.js|akismet\.js|akismet\.css)$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>
# Akismet images
<FilesMatch "^logo-full-2x\.png$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>
EDIT 4:
wp-admin is working fine, its only the website itself. The Wordpress Adress (URL) and Site address (URL) both set to the http://test.example.com