欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

Linux下安装nginx

程序员文章站 2022-06-27 20:24:32
安装前先安装一些依赖库:yum install opensslyum install openssl-develyum install pcreyum install pcre-develyum install zlibyum install zlib-devel安装:输入:wgethttp://tengine.taobao.org/download/tengine-2.3.2.tar.gztar xvf tengine-2.3.2.tar.gzcd tengi....

安装前先安装一些依赖库:

yum install openssl

yum install openssl-devel

yum install pcre

yum install pcre-devel

yum install zlib

yum install zlib-devel

安装:

输入:

wget http://tengine.taobao.org/download/tengine-2.3.2.tar.gz

tar xvf tengine-2.3.2.tar.gz

cd tengine-2.3.2

./configure --prefix=/usr/local/software/tengine --add-module=./modules/ngx_http_upstream_check_module

make

make install

配置nginx:

注意,反向代理配置的地方(location/)增加两行:

proxy_cookie_path / "/; httponly; secure; SameSite=Lax";

add_header X-Frame-Options SAMEORIGIN;

Linux下安装nginx

注意如果需要配置conf.d文件需要在nginx.conf中配置:

include /usr/local/software/tengine/conf/conf.d/*.conf;

本文地址:https://blog.csdn.net/dreamwei888/article/details/107383262