局域网建两个网站我希望通过IP+端口访问网站
例如:
192.168.3.10:18080
192.168.3.10:18081
那我的nginx.conf需要怎么配置
我是用docker部署的lnmp
我的nginx.conf配置文件只实现了一个
192.168.3.10:18080
user www;
worker_processes auto;
worker_cpu_affinity auto;
pid logs/nginx.pid;
events {
worker_connections 102400;
}
http {
charset utf-8;
server_tokens off;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
include mime.types;
default_type application/octet-stream;
client_max_body_size 20M;
sendfile on;
keepalive_timeout 20;
gzip on;
gzip_vary on;
gzip_comp_level 1;
gzip_types text/css application/javascript application/json image/png image/webp image/apng image/jpeg image/x-icon;
error_log /www/z_error.log;
access_log /www/z_$host.log main;
server {
listen 80;
server_name www.test.com;
root /www/www.test.com;
location / {
index index.php index.html index.htm;
}
location ~* \.php {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
}