"Nginx" uses Nginx as the HTTP proxy configuration file

Source: Internet
Author: User

See comments in the configuration file ~

#user  nobody;worker_processes  1; #pid        logs/nginx.pid;events {    worker_connections  1024;} HTTP {    include       mime.types;    Default_type  Application/octet-stream;    Server_tokens off;    Sendfile on        ;    Keepalive_timeout  ;    gzip on  ;    Upstream API {        server 127.0.0.1:9178;    }    server {        listen       8080; #监听8080端口        server_name  localhost; #相当于IIS中的主机头        error_log   logs/ Bookms.error.log;        CharSet Utf-8;        Location/{          #默认跳转到http://127.0.0.1:9000          proxy_pass http://127.0.0.1:9000;        }        #当URL符合 ^\/(API) rules, jump to http://127.0.0.1:9178, that is, the value configured in upstream location        ~ ^\/(API) {            Proxy_pass http://api;            Proxy_set_header    x-real-ip   $remote _addr;            Client_max_body_size    100m;}}}    

"Nginx" uses Nginx as the HTTP proxy configuration file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.