我在 Strato 托管我的域并永久重定向到我的 linux 服務器。這很好,但我想更改 URL,以便它們不是我服務器的 IP,而是原始域的名稱。
因此,我呼叫例如www.page.de并將其重定向到 myip/outfitcreator。但是我想要www.page.de/outfitcreator而不是 myip 。
有什么解決辦法嗎?
這是我的 nginx 檔案
server {
listen 80;
server_name xx.xx.xxx.xxx;
location / {
root /var/www/kioskJPE/html;
index index.html;
}
location /upload {
alias /var/www/fileUpload/html/upload;
}
location /downloadfiles{
alias /var/www/fileUpload/html;
}
location /uploadFiles {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /outfitcreator {
alias /var/www/outfitcreator/html;
}
}
非常感謝你!
uj5u.com熱心網友回復:
您可能有點過于復雜了——我建議創建一個 DNS A 記錄,將您的域與服務器的 IP 地址聯系起來,而不是進行重定向(因為在 Strato 上似乎沒有任何東西,而是在您的 Linux 服務器上)。DNS 記錄應該指向您的 NGINX 服務器的 IP,并且您需要將 server_name 添加到服務器塊以確保正確處理它
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/414241.html
標籤:
上一篇:范圍標題,視頻
