Use Nginx as the reverse proxy (scheduler) to access the virtual Web host

Source: Internet
Author: User
Tags fpm

Virtual Web Host:

Build LNMP Service
Installation
Nginx
MARIADB, Mariadb-server, Mariadb-devel
PHP, PHP-FPM, Php-mysql
Start Nginx, MariaDB, FPM service;
and test whether the LNMP is working properly.
Build two Web services with different domain names

Proxy Server:
Build Nginx Service
#vim/usr/local/nginx/conf/nginx.conf
......
HTTP {
Server_tokens off;
Client_header_buffer_size 1k;
Large_client_header_buffers 4 4k;
Include Mime.types;
Default_type Application/octet-stream;
Upstream Web {
Server 201.1.2.100 weight=2 Max_fails=1 fail_timeout=30;
}
server {
Listen 80;
server_name localhost;

            charset utf-8;           #access_log  logs/host.access.log  main;    location / {           proxy_pass http://web;          proxy_set_header Host $host;   主要配置,不写就会访问不到第二个虚拟主机        index  index.html index.htm;    }

........

#nginx-S Relod
On Client Access
#vim/etc/hosts
Scheduler IP Address www.a.com www.b.com
Accessing Tests with a browser

Use Nginx as the reverse proxy (scheduler) to access the virtual Web host

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.