簡體   English   中英

如果沒有在 API 請求中指定端口號,服務器如何確定此請求是針對端口 80 或 443

[英]Without specifying a port number inside of a API request how server decided that this request is for port 80 or 443

我沒有在我的 api 端點中提到端口號,但是服務器如何決定使用端口 80 或 443 來服務這個請求

const {data} = await axios.get('/api/users/currentuser');

在 NGINX 中使用這樣的東西:

server {
  root /var/www/html;
  
  server_name _;

# this is the react/angular fronted application endpoints
  location / {
    try_files $uri $uri/ /index.html;
  }

# this is the api endpoints
  location /api {
    proxy_pass http://127.0.0.1:8000;
  }
}

但是,您尚未在問題中明確提及,您是否正在使用NGINX,但您是否有ZEE434023CF89D7DFB21F63D7DF63D63D63D64F64F0F9D74Z在該問題的5 tags中,您必須將您的5次imandyy ardyy yyy im i y im im i im im i im i im i im i im im im i im i im im i im i im i im i im im i im i im assion。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM