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