From f4ce1b860f777a335720cbcdfb5639e07e0960e2 Mon Sep 17 00:00:00 2001 From: saiminh Date: Thu, 8 Jan 2026 18:28:39 +1300 Subject: [PATCH] use ip --- DEPLOYMENT.md | 7 +++++-- nginx.conf.example | 13 ++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index db76a76..b956759 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -44,11 +44,14 @@ The last command (`pm2 startup`) will give you a command to run with sudo to ena sudo cp nginx.conf.example /etc/nginx/sites-available/floter-design ``` -2. Edit the configuration with your domain: +2. Edit the configuration: ```bash sudo nano /etc/nginx/sites-available/floter-design ``` - Replace `your-domain.com` with your actual domain name. + + **If using IP address** (no domain yet): The config already has `server_name _;` which will work for IP access. You can optionally replace `_` with your actual IP address. + + **If using a domain**: Comment out the IP-based server block and uncomment the domain-based one, then replace `your-domain.com` with your actual domain name. 3. Enable the site: ```bash diff --git a/nginx.conf.example b/nginx.conf.example index d7cba3c..2de3562 100644 --- a/nginx.conf.example +++ b/nginx.conf.example @@ -4,10 +4,20 @@ # Test config: sudo nginx -t # Reload: sudo systemctl reload nginx +# OPTION 1: Using IP address (use this if you don't have a domain) +# Replace '_' with your actual IP address if you want to be more specific +# For example: server_name 123.45.67.89; + server { listen 80; listen [::]:80; - server_name your-domain.com www.your-domain.com; # Replace with your domain + server_name _; # '_' catches all requests, or use your IP address like: 123.45.67.89 + +# OPTION 2: Using domain name (uncomment this and comment out OPTION 1 when you have a domain) +# server { +# listen 80; +# listen [::]:80; +# server_name your-domain.com www.your-domain.com; # Replace with your domain # Redirect HTTP to HTTPS (uncomment after setting up SSL) # return 301 https://$server_name$request_uri; @@ -31,6 +41,7 @@ server { } } +# When you get a domain, you can add HTTPS configuration below: # HTTPS configuration (uncomment and configure after SSL certificate setup) # server { # listen 443 ssl http2;