use ip
This commit is contained in:
parent
ed2f5a449c
commit
f4ce1b860f
2 changed files with 17 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue