I am running lighttpd 1.4.31 with ssl support and am having an issue with forcing https on a specific virtualhost. If I disable the redirect line from the following config, it works as expect (http and https both working, but no redirection), but when I enable it, I find the browser gets cause in a loop of 301s.
I have a server with multiple domains. Both http (apache) traffic and http-alt (tomcat) traffic.
If/when I take the server down, I'd like to be able to redirect people to a temporary 'undergoing maintenance' page, regardless of their destination URL/port.
How can this be achieved?
I would like to redirect domains on HTTP/HTTPS:
http://old.com -> https://new.com
https://old.com -> https://new.com
I have to specify the SSL key/certificate for the old domain but I'm not sure where I have to place these directives:
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/pki/tls/private/new.com.pem"
ssl.ca-file = "/etc/pki/tls/certs/new.com.crt"
}
$SER
Following the how-to, I wanted to make a proxy for traffic to the address /app to be processed by Tomcat 7.
I want redirect all traffic to example.com/* to be redirected to www.example.com/*
I found How can I redirect any ServerAlias to the respective ServerName?
I had a lighttpd server which works normally. I can access this website from outside(non-localhost) via http://vm.aaa.com:8080. Let's just assume that it's a simple static website, without php or mysql.
Now I want to copy this website as a test one(using another port) in the same machine. And I do not want to use virtual host.
I have a web server running on port 8080. I'd like to visit it via port 80, so I did this:
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-port 8080
it works if i access the server from other machines using
http://ipoftheserver/
but it doesn't work if I access the server from the same machine using
http://localhost/
why is that?
thanks in advance.
i have this iptables and working.
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 0:20 -j REDIRECT --to-port 8080 #bypass SSH
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 23:442 -j REDIRECT --to-port 8080 #bypass SSL
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 444:2082 -j REDIRECT --to-port 8080 #Cpanel SSL
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 2084:2086 -j RE
I'm trying to redirect all HTTP/HTTPS trafic from one server to another (via IP).
I do use the ufw firewall. How can I configure it do to so?