kekoke commented on issue #6648:
URL: https://github.com/apache/apisix/issues/6648#issuecomment-1096446287

   > Hi @tzssangglass, sorry for I have one more qunestion. I note that When I 
exclude --resolve parmeter in command, I will got the 404. As I know Nginx will 
forward to http request of `apigw-dev.com` to `127.0.0.1:9080(0.0.0.0:9080)` in 
the Server, Why are we adding `--resolve 'apigw-dev.com:80:127.0.0.1'` into 
CURL request?
   
   Hi tzssangglass, I foud a solution to replace '--resolve' command,
   I add `services` in request header to replace `Host` as below
   ```
   curl --location --request GET 'http://apigw-dev.com/api/account/info' \
   --header 'services: uat-sanctions-api.com' 
   ```
   and update `nginx` config `proxy_set_header Host $host`  to 
`proxy_set_header Host $http_services;`
   ```
   server {
           listen       80;
           server_name  apigw-dev.com;
   
           location / {
               proxy_pass http://0.0.0.0:9080; # APISIX admin API
               proxy_set_header Host $http_services; # pass Host header to 
upstream, it's important
               root   /home/application;
               index  index.html index.htm;
           }
   
           error_page   500 502 503 504  /50x.html;
           location = /50x.html {
               root   html;
           }
   
   }
   ```
   Just sharing, thanks again!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to