Answer the question
In order to leave comments, you need to log in
Redirect loop - how to assign alias?
I'm trying to redirect - anydmoain.tld/webmail / anydmoain.tld/myadmin > specialdomain.tld/ webmail / specialdomain.tld/ myadmin
It goes into loop, what should I do?
Configs:
/etc/httpd/conf/httpd.conf:
<VirtualHost 1.1.1.1:81 >
ServerName domain.tld
CustomLog /var/www/httpd-logs/domain.tld.access.log combined
DocumentRoot /var/www/domain/data/www/domain.tld
ErrorLog /var/www/httpd-logs/domain.tld.error.log
ServerAdmin [email protected]
ServerAlias domain.info www.domain.tld www.domain.info
SuexecUserGroup domain domain
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
php_admin_value open_basedir "/var/www/domain/data:."
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f [email protected]"
php_admin_value upload_tmp_dir "/var/www/domain/data/mod-tmp"
php_admin_value session.save_path "/var/www/domain/data/mod-tmp"
ScriptAlias /cgi-bin/ /var/www/domain/data/www/domain.tld/cgi-bin/
Alias /manager /usr/local/ispmgr/bin/
Alias /manimg/ /usr/local/ispmgr/skins/
Alias /mancgi/ /usr/local/ispmgr/cgi/
Alias /myadmin /var/www/phpmyadmin/
Alias /webmail /var/www/roundcube/
Redirect permanent /manager/ispmgr/ /manager/ispmgr
</VirtualHost>
location / {
if ($http_user_agent ~ (^$|-|ApacheBench/2.3)$) {
return 444;
}
limit_req zone=req burst=3;
}
location ~ ^/webmail(.*)$ { rewrite ^ https://domain.tld/webmail/ permanent;}
location ~ ^/myadmin(.*)$ { rewrite ^ https://domain.ltd/myadmin/ permanent;}
location ~ ^/webmail(.*)$ { rewrite ^ https://domain.tld/webmail/ permanent;}
location ~ ^/myadmin(.*)$ { rewrite ^ https://domain.tld/myadmin/ permanent;}
location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
proxy_pass http://1.1.1.1:81;
proxy_redirect http://1.1.1.1:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
Answer the question
In order to leave comments, you need to log in
Doctor, my head hurts, here's your finger, tell me what's wrong with your head :) (sarcasm)
What is written in the nginx config in the server section in the server_name parameter?
But forget it, you have in /etc/httpd/conf/httpd.conf:
Here's a loop for you.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question