Nginx how to set up reverse proxy

Source: Internet
Author: User


Network structure such as.
Maybe you have only one IP address for the public network. But your intranet has a Web site that needs to be mapped to an extranet. Instead of adding other non-80 ports, you can use Nginx directly to do the reverse proxy.
First, configure the nginx.conf file.

http {include mime.types; Default_type Application/octet-stream;    Client_max_body_size 8m; ################################################################################include/usr/local/u-mail/config/nginx/reverse-proxy.conf; ################################################################################    #Log_format main ' $remote _addr-$remote _user [$time _local] "$request" '    #' $status $body _bytes_sent ' $http _referer '    #' "$http _user_agent" "$http _x_forwarded_for";    #access_log Logs/access.log main;sendfile on; #Tcp_nopush on;    #keepalive_timeout 0;Keepalive_timeout 65; #gzip on;upload_progress proxied 1m; ###############################################################################gzip on; #client_max_body_size 50m;client_body_buffer_size 256k;    Client_header_timeout 3m;    Client_body_timeout 3m;    Send_timeout 3m;    Proxy_connect_timeout 300s;    Proxy_read_timeout 300s;    Proxy_buffer_size 64k; Proxy_buffers432k;    Proxy_busy_buffers_size 64k;    Proxy_temp_file_write_size 64k;             Proxy_ignore_client_abort on; ###############################################################################Include vhost/*. conf;}





The above configuration file has the reference/usr/local/u-mail/config/nginx/reverse-proxy.conf;
Configuration file, this fill can use a relative path, you can also fill in the absolute path, in order to demonstrate the direct fill in the absolute path.
Then look at the referenced configuration file information.


As above. Then directly restart the service. See if it is normal. If there is no error message. If you have multiple sites, you can set up more than one server segment in a reverse-proxy.conf. A site is a segment. The next check is convenient. .

Nginx how to set up reverse proxy

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.