How do I change Nginx so I can add a subdomain to the domain? For example:
www.example.com
convert to www.example.sub1.com
server {
listen 80;
server_name %domain%;
location / {
proxy_pass http://%frontend%;
}
location ^~/graphql {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://%api%;
}
}
After "server_name" enter your domains. For example:
server_name yourdomain.com www.yourdomain.com;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.