Nginx Basic Use

Source: Internet
Author: User

Nginx Basic Use

Download Source Package http://nginx.org/

Http://nginx.org/en/download.html

Yum-  y install "@ Dev Tools" Pcre  pcre-devel  OpenSSL openssl-develtar-zxvf nginx-xxxx.tar.gz./configure--help ./configure--prefix=/usr/local/nginx--user=www--group=www--with-http_ssl_modulemake && make Installuseradd-s/sbin/nologin-  m  www

/usr/local/nginx/sbin/nginx option-h-s Stop Nginx process-V View software version-v configuration parameter when installing software-c specifies that the Nginx process uses that configuration file to run-t Check default configuration file nginx.conf for syntax errors

Pkill   -9 Nginxkill signal PID number-int-quit-hup-usr1-usr2-winchkill   -hup  ' cat/usr/local/nginx/logs/nginx.pid '

Basic Web Services

HTTP {server {listen 80;server_name localhost;location/{root html;index index.html;} Location path {root Html;index index.html;}} server {}}

Domain-based virtual hosting: Publishing to public network clients

Port-based + IP-based: Publish Web site Admin page in private network

1. Domain Name Virtual host
server {Listen 80;server_name www.xzdz.hk;location/{root/wwwdir;index index.html index.htm;} ..........} server {Listen 80;server_name bbs.xzdz.hk;location/{Root/bbsdir;index index.html;}}

2. Port Virtual Host
server {Listen 80;location/{root html;index index.html;}} server {Listen 8000;location/{Root/bbsdir;index index.html;} server {Listen 8090;location/{Root/wwwdir;index index.html;}}

3.ip Virtual Host
server {Listen 1.1.1.253:8080;location/{Root/admindir;index index.html;}} server {Listen 1.1.1.254:80;location/{Root/wwwdir;index index.html;}} server {Listen 1.1.1.253:80;location/{Root/bbsdir;index index.html;}}

 

Nginx Basic Use

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.