草庐IT

nginx布署html静态页面

如何在nginx中部署:htmlCat/etc/nginx/nginx.conf找到80端口下面的路径;root        /usr/share/nginx/html;将html找到这个路径下面;DOS:E:\vsproject\.vscode>scplogin.htmlroot@IP:/rootCdroot下:[root@instance-ws9c56wt~]#cplogin.html/usr/share/nginx/html[root@instance-ws9c56wt~]#cd/usr/share/nginx/html[root@instance-ws9c56wthtml]#llto

安装nginx--银河麒麟V10(Kylin Linux Advanced Server release V10 (Tercel))操作系统

前言1、安装nginx之前,在内网环境下需要先进行配置本地yum源。2、本文使用的操作系统:银河麒麟V10飞腾版3、查看操作系统CPU型号[root@localhost/]#lscpu4、查看操作系统信息cat/etc/*release5、安装的版本:nginx-1.16.1.tar.gz一、获取源代码软件获取路径:http://nginx.org/download/nginx官网:http://nginx.org/二、编译环境配置执行如下命令,安装依赖包。yuminstallgccgcc-c++makeunzippcrepcre-develzlibzlib-devellibxml2libxm

Nginx 文件名逻辑漏洞(CVE-2013-4547)(Vulhub)

Nginx文件名逻辑漏洞(CVE-2013-4547)(Vulhub)漏洞简介在Nginx0.8.41~1.4.3/1.5.0~1.5.7版本中存在错误解析用户请求的url信息,从而导致文件代码执行,权限绕过等问题。适用环境Nginx0.8.41~1.4.3/1.5.0~1.5.7版本漏洞成因漏洞成因大概为Nginx本身并不能解析PHP代码,只能通过加载PHP模块来进行解析代码。通过正则表达式来匹配以.php结尾的请求路径交给PHP模块去解析,但是Nginx在加载文件名时遇到‘\0’便会停止读取‘\0’后面的内容,于是通过以上思路,我们在进行文件上传的时候,文件名应该设置为1.gif,在进行访

python - django nginx静态文件404

这是我的设置:STATIC_URL='/static/'STATICFILES_DIRS=(os.path.join(BASE_DIR,"static"),)STATIC_ROOT='/home/django-projects/tshirtnation/staticfiles'这是我的nginx配置:server{server_name77.241.197.95;access_logoff;location/static/{alias/home/django-projects/tshirtnation/staticfiles/;}location/{proxy_passhttp://1

python - django nginx静态文件404

这是我的设置:STATIC_URL='/static/'STATICFILES_DIRS=(os.path.join(BASE_DIR,"static"),)STATIC_ROOT='/home/django-projects/tshirtnation/staticfiles'这是我的nginx配置:server{server_name77.241.197.95;access_logoff;location/static/{alias/home/django-projects/tshirtnation/staticfiles/;}location/{proxy_passhttp://1

nginx 常用配置之 pass_proxy

大家好,我是17。今天和大家聊聊pass_proxy代理。pass_proxy代理在前端代理主要是为了跨域。虽然前端跨域有多种方法,各有利弊,但用代理来跨域对开发是最友好的。用代理可以不用修改产品代码切换线上线下,非常安全。pass_proxy默认会把cookie也一同转发。常用的配置非常简单。不带斜杠前端/api/user后端/api/userlocation^~/api/{proxy_passhttp://127.0.0.1:3001;}不带斜杠把path直接拼接在url后面;带斜杠前端/api/user后端/userlocation^~/api/{proxy_passhttp://127

Nginx报错host not found in upstream解决办法

项目说明前后台分离项目,后台所属空间没有存储图片,放置前台空间存储,后台需要查看图片,借助proxy_pass。对应配置如下test.confserver{listen80;server_nameadmin.test.com;root/www/test/admin}server{listen80;server_namewww.test.com;root/www/test/web}test.htaccesstry_files$uri$uri//index.html;location/uploads{proxy_passhttp://www.test.com/uploads;}当初配置完成的时候,

nginx解决不必要的 Http 响应头漏洞(自定义server信息及隐藏版本号)

1.自定义server信息修改nginx解压目录下的/src/core/nginx.h文件  修改nginx解压目录下的/src/http/ngx_http_header_filter_module.c文件修改 nginx解压目录下的/src/http/ngx_http_special_response.c文件 全部修改完成后,执行./configure--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_sub_module--with-http_ssl_module随后执行make,切记不要执行make&&ma

使用nginx处理的一些安全漏洞

1、响应头缺失HTTPX-Permitted-Cross-Domain-Policies响应头缺失Nginx的nginx.conf中location下配置:add_headerX-Permitted-Cross-Domain-Policiesvalue;HTTPReferrer-Policy响应头缺失Nginx的nginx.conf中location下配置:add_header'Referrer-Policy''origin';HTTPX-Content-Type-Options响应头缺失Nginx的nginx.conf中location下配置:add_headerX-Content-Type

Nginx目录结构简介:深入理解Nginx的默认文件和目录

第一章Nginx的默认目录结构当你安装Nginx后,它的默认目录结构如下:├──conf│├──mime.types│├──nginx.conf│└──sites-enabled│└──default├──html│├──50x.html│└──index.html├──logs│├──access.log│└──error.log└──sbin└──nginx让我们逐个了解这些目录和文件的作用。第二章conf目录conf目录包含了Nginx的配置文件,其中nginx.conf是Nginx主配置文件,它包含了所有全局的Nginx配置项。mime.types文件包含了MIME类型的定义,它告诉N