Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Implementation of Nginx Domain name forwarding

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Nginx introduction

Nginx ("engine x") is a high-performance Web and reverse proxy server developed by Russian programmer Igor Sysoev. It is also an IMAP/POP3/SMTP proxy server. In the case of high connection concurrency, Nginx is a good alternative to Apache servers.

Nginx installation

1. Install compilation tools and library files

Yum-y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel

two。 Install PCRE

Download and extract the source package cd installation directory by yourself. / configure make & & make install// compilation and installation

3. Install Nginx

Download and extract the source package cd installation directory by yourself. / configuremakemake install

Nginx common commands

# under the nginx/sbin directory # start nginx./nginx## and close nginx./nginx-s stop## to reload the configuration file. / nginx-s reload

Domain name forwarding configuration

The following is my configuration file, I only configured a simple domain name forwarding function, did not use other nginx features, nginx is extremely powerful, domain name forwarding is just the tip of the iceberg.

# # nginx/conf/nginx.confworker_processes 1 listen events {worker_connections 1024;} http {include mime.types; default_type application/octet-stream; sendfile on; server {listen 80; server_name www.fbm.com; location / {root html; index index.html index.htm; proxy_pass http://localhost:8080;}} server {listen 80; server_name fmp.hzfh.com Location / {proxy_pass http://fmp.hzfh.com;}

Note: don't forget to open the port on the firewall.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 282

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report