Practiced hand nginx reverse proxy Apache Combat

Source: Internet
Author: User
Tags nginx reverse proxy

First of all, the original rational

What is a reverse proxy

The user accesses the domain name to the Nginx to send the request to the Apache Apache processing to return to the user the entire set of logic

For the user to access the domain name and then return no feeling.

The forward proxy is the user Access Proxy and then the proxy server accesses the network.

Idea Finishing

The user accesses the domain name corresponding to the 80 port, so nginx configuration is bound to 80 ports then 80 ports are occupied Apache can only use other ports to do binding, such as 8080

Detailed steps

1 Nginx needs to configure the file to access the domain name and set up the reverse proxy

upstream homework.6328.net{server 127.0.0.1:8080;} server{Listen the; server_name homework.6328. NET; Location~ ^/nginxstatus/{stub_status on;    Access_log off; } Location/{root/var/www/laravelhomework/ Public;               Index index.php index.html index.htm; proxy_pass http: //homework.6328.net;                #Proxy Settings proxy_redirect off;                Proxy_set_header Host $host;                Proxy_set_header X-real-ip $remote _addr;                Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;                Proxy_next_upstream Error timeout Invalid_header http_500 http_502 http_503 http_504;                Proxy_max_temp_file_size 0;                Proxy_connect_timeout 90;                Proxy_send_timeout 90;                Proxy_read_timeout 90;                Proxy_buffer_size 4k; Proxy_buffers 4 32k;                Proxy_busy_buffers_size 64k;    Proxy_temp_file_write_size 64k; }}

Labeling Red is the setting of the reverse proxy server

Other Settings various paths

2 Apache section set access binding 8080 port set domain name access detailed directory

<virtualhost *:8080>    "/var/www/laravelhomework/public"     ServerName homework. 6328 . net.conf</virtualhost>~

Practiced hand nginx reverse proxy Apache Combat

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.