nginx域名转发

前提
服务器:10.10.100.100 端口:80 (需要映射到公网端口)

安装Nginx
此处省略…

vi /etc/nginx/nginx.conf

user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';


access_log  /var/log/nginx/access.log  main;


sendfile        on;
#tcp_nopush     on;


keepalive_timeout  65;


proxy_headers_hash_max_size 51200;
proxy_headers_hash_bucket_size 6400;

指定域名配置文件夹

include /etc/nginx/conf.d/*.conf;

你可能感兴趣的:(nginx,nginx,运维,服务器)