V2ray代理安装成功,想继续在vps上该nginx的配置搭建网站,该如何操作呢?
-
我在网上看了一下。 搭建网站应该需要改nginx.conf 的配置。 但是我看了vps里面的配置,感觉和一般的配置不一样。 这个需要修改哪些呢?
我看了一下nginx的配置文件,好像是在这里。 /etc/nginx/nginx.conf
好像都是改events ,但是一键安装的好像不太一样。
所以请教一下。
events {
worker_connections 1024;
}http {
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; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf;
d /run/nginx.pid;
Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
-
/etc/nginx/nginx.conf文件基本上不需要改什么(当然也可以改gzip压缩,server_tokens之类的)
要新增一个网站,在/etc/nginx/conf.d目录下新建一个.conf结尾的文件,里面填写server段的内容,然后重启nginx就可以了