nignx配置文件解析
https://blog.csdn.net/u011262253/article/details/120941175
nginx下载链接
http://nginx.org/en/download.html
下载nginx
wget http://nginx.org/download/nginx-1.18.0.tar.gz
preinstall
yum -y install pcre-devel
yum -y install openssl openssl-devel
安装nginx
tar -zxvf nginx-1.18.0.tar.gz
tar zxvf /root/nginx-1.18.0.tar.gz -C /usr/local/nginx
cd nginx-1.18.0
./configure
make && make install
安装完成后,Nginx的可执⾏⽂件位置位于
/usr/local/nginx/sbin/nginx
启动停止重载命令
/usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx -s stop
/usr/local/nginx/sbin/nginx -s reload
配置文件位置
/usr/local/nginx/conf/nginx.conf
ruoyi-vue 版本 nginx配置文件
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
charset utf-8;
location / {
root /home/ruoyi/projects/ruoyi-h5;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
# 默认所有路径
location /prod-api/ {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE_HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
# 反向代理配置
proxy_pass http://localhost:8080/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
./nginx #启动
./nginx -s stop #停止
./nginx -t #检查
./nginx -s quit #退出
./nginx -s reload #重载
ssl报错解决方法
https://blog.csdn.net/qq_42023877/article/details/128237319