Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Nginx Redirect Reply To: Nginx Redirect

#186007
Alen
Participant

Nginx config file domain.net.conf in /etc/nginx/sites-available, don’t forget to system link it to sites-enabled folder and reboot Nginx.


server {

        listen 80;
        server_name domain.net;
        root /folder/on/the/server/www;

        location / {
            rewrite ^(.*)$ http://www.domain.me/$1 redirect;
        }

        location ~ /\.ht {
            deny all;
        }
}