Multiple Domains
Since Sliplane currently doesn’t support multiple custom domains on a single service, you’ll need a separate redirect service if you want to handle both example.com
and www.example.com
. This guide shows you how to set up a simple NGINX-based redirect service.
Prerequisites
- A Sliplane account
- A service with a custom domain setup (example.com in this case)
Setting up the Redirect Service
Create a new Dockerfile
:
FROM nginx:alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Create an nginx.conf
file:
server { listen 80; server_name www.example.com;
location / { return 301 https://example.com$request_uri; }}
Replace www.example.com
and example.com
with your domains.
Push both files to any Github repository.
Deploy the service to Sliplane:
- Create a new service
- Set PORT environment variable to 80
- Set the custom domain to your www domain (e.g.,
www.example.com
)
Now, when users visit your www domain, they will be automatically redirected to your apex domain while preserving the path and query parameters.