This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
856
Other / Re: Can I redirect the server's IP to a domain?
« on: January 26, 2020, 04:04:05 PM »
you could use 301 redirects in the proper software config.
nginx:
server {
listen [ip]:80;
listen [ip]:443 ssl;
server_name [ip];
root /some/directory/to/server/files/but/not/used
return 301 https://example.com$request_uri;
}
*** Alternatively, you can set one of your websites as listen [host]:443 default_server ssl;
Apache:
<VirtualHost [ip]:80>
ServerName [ip]
Redirect 301 / https://example.com/
</VirtualHost>
<VirtualHost [ip]:443>
ServerName [ip]
Redirect 301 / https://example.com/
</VirtualHost>
If you use Varnish, it get's complicated quickly
nginx:
server {
listen [ip]:80;
listen [ip]:443 ssl;
server_name [ip];
root /some/directory/to/server/files/but/not/used
return 301 https://example.com$request_uri;
}
*** Alternatively, you can set one of your websites as listen [host]:443 default_server ssl;
Apache:
<VirtualHost [ip]:80>
ServerName [ip]
Redirect 301 / https://example.com/
</VirtualHost>
<VirtualHost [ip]:443>
ServerName [ip]
Redirect 301 / https://example.com/
</VirtualHost>
If you use Varnish, it get's complicated quickly