首页
网站导航
关于
Search
1
解决Typecho Joe主题访问fastly.jsdelivr.net速度慢的方案 | 快速优化技巧
2,190 阅读
2
解决WSL2内存不释放问题的最佳指南
1,401 阅读
3
如何在 Typecho Joe 主题的文章中增加目录
1,170 阅读
4
GO语言环境的搭建教程 - 完全指南
1,004 阅读
5
如何解决Win11电脑桌面上方显示横线问题 | 窗口11教程
1,004 阅读
默认分类
编程语言
GO语言
PHP
Node
javascript
html
rust
java
Css
Python
资源分享
chrome插件
阅读思考
运维架构
redis
Nginx
linux
memcached
mongodb
mysql
windows
docker
k8s
Mq
apache
CI
Git
swoole
elk
系统设计
thinkPhp
beego
登录
Search
标签搜索
重要
go基础
git 命令
go包
phpstorm
sublime
thinkphp6
mysql问题
软件分享
redis命令
php基础
thinkphp3.2
php第三扩展包
小蚯蚓博客
累计撰写
333
篇文章
累计收到
48
条评论
首页
栏目
默认分类
编程语言
GO语言
PHP
Node
javascript
html
rust
java
Css
Python
资源分享
chrome插件
阅读思考
运维架构
redis
Nginx
linux
memcached
mongodb
mysql
windows
docker
k8s
Mq
apache
CI
Git
swoole
elk
系统设计
thinkPhp
beego
页面
网站导航
关于
搜索到
7
篇与
的结果
2023-10-07
专业Nginx HTTPS配置指南 | 如何有效地设置您的Nginx
下载 Nginx 服务证书 确定下文件有没有准备好,一份 SSL 证书、一份对应的私钥 KEY 文件(这里是用的 pem 与 key 文件, https://freessl.cn/ ,这个地方可以免费申请证书)上传到服务器上,编辑 conf 的时候注意你的这俩文件名字,跟跟服务器上的一致。 ssl. pem; ssl. key; 这个有时候后缀是 ssl. pem,没什么关系 把这两个文件复制到对应目录里面。 使用acme自动部署:https://blog.freessl.cn/acme-quick-start/ 先安装证书到本地 然后安装到nginx acme.sh --install-cert -d www.xiaoqiuyinboke.cn \ --key-file /usr/local/nginx/conf/ssl/www_xiaoqiuyinboke_cn_key.pem \ --fullchain-file /usr/local/nginx/conf/ssl/www_xiaoqiuyinboke_cn_cert.pem \ --reloadcmd "/usr/local/nginx/sbin/nginx -s reload" 配置 nginx server { # 监听的端口,nginx 1.15.0及以上版本,使用listen 443 ssl代替,1.15.0以下的使用listen 443 listen 443 ssl; server_name www.xiaoqiuyinboke.cn; #charset koi8-r; # ssl证书地址 # 指定pem文件所在路径,如果写相对路径,必须把该文件和nginx.conf文件放到一个目录下。 ssl_certificate ssl/cert.pem; # 指定私钥文件key所在路径,如果写相对路径,必须把该文件和nginx.conf文件放到一个目录下。 ssl_certificate_key ssl/key.pem; # ssl验证相关配置 # 缓存有效期 ssl_session_timeout 5m; # 加密算法 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; # 安全链接可选的加密协议 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # 使用服务器端的首选算法 ssl_prefer_server_ciphers on; #access_log logs/host.access.log main; root /usr/local/wqy/www/typecho/; location / { add_header Access-Control-Allow-Origin *; try_files $uri $uri/ /index.php?$query_string; index index.html index.htm index.php; autoindex on; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .+\.php($|/) { add_header Access-Control-Allow-Origin *; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi.conf; #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} # include ./conf/vhost/*.conf; } # 配置80端口重定向443端口 server { listen 80; server_name www.xiaoqiuyinboke.cn; rewrite ^(.*)$ https://${server_name}$1 permanent; }
2023年10月07日
154 阅读
0 评论
0 点赞
2023-10-07
Nginx缓存配置专家 | 提高网站性能和速度
nginx 可以设置下缓存,提高响应速度 http { ... # 压缩,效果明显,430kb的被压缩成132kb gzip on; gzip_min_length 1024; gzip_comp_level 4; # 设置缓存空间 gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; server { ... location ~* .(jpg|jpeg|png|gif|ico|css|js)$ { expires 365d; # 和缓存空间配合,这个需要独立的静态ip地址 proxy_pass ip:port; proxy_cache my_cache; proxy_cache_valid 1d; } ... } ... }
2023年10月07日
129 阅读
0 评论
0 点赞
2023-01-27
如何在 Windows 上安装 Nginx 服务 - 全面指南
下载 Nginx 安装包 首先下载 windows 版的 Nginx 安装包 下载 Windows Service Wrapper 工具 选择合适版本下载,该工具可设置nginx为windows服务。Github源码地址,下载页面如下图; 下载后把下载的 winsw-2.1.2-bin.exe 文件放在 Nginx 安装目录。并修改名称为 nginx-service.exe,然后分别创建 nginx-service.exe.config,nginx-service.xml 文件,把这两个文件放在 Nginx 安装目录下。如下图 nginx-service.exe.config内容如下: <configuration> <startup> <supportedRuntime version="v2.0.50727" /> <supportedRuntime version="v4.0" /> </startup> <runtime> <generatePublisherEvidence enabled="false"/> </runtime> </configuration> nginx-service.xml内容如下: <service> <id>nginx</id> <name>Nginx Service</name> <description>High Performance Nginx Service</description> <logpath>C:\Program Files\Nginx\logs</logpath> <log mode="roll-by-size"> <sizeThreshold>10240</sizeThreshold> <keepFiles>8</keepFiles> </log> <executable>C:\Program Files\Nginx\nginx.exe</executable> <startarguments>-p C:\Program Files\Nginx</startarguments> <stopexecutable>C:\Program Files\Nginx\nginx.exe</stopexecutable> <stoparguments>-p C:\Program Files\Nginx -s stop</stoparguments> </service> 安装nginx服务 进入Nginx安装目录,然后执行命令 nginx-service.exe install
2023年01月27日
301 阅读
0 评论
0 点赞
2022-05-17
如何配置Nginx上传文件大小 | Nginx配置教程
概述 PHP 大文件上传报错 413 Request Entity Too Large,这个时候是上传文件超过Nginx配置的大小了。 解决办法 修改Nginx配置文件 http{ # 改为20M client_max_body_size 20m; } 配置完成之后,重启Nginx即可
2022年05月17日
269 阅读
0 评论
0 点赞
2022-05-17
解决Nginx请求参数过多的问题 | 专业指导
一、概述 当url参数太多的时候,nginx 会报一个 nginx 414 Request-URI Too Large 的错误。 二、解决办法 修改 nginx.conf 配置即可:http { client_header_buffer_size 512k; large_client_header_buffers 4 512k; } 配置完成之后,重启Nginx即可
2022年05月17日
265 阅读
0 评论
0 点赞
2022-05-15
详细教程:如何编译安装Nginx
概述 本篇安装教程是基于 nginx-1.18.0 版本的安装,不过最新版本应该也是这个安装方式 安装 访问官网 http://nginx.org/ 获取下载地址 解压安装包 安装依赖 # rewrite 模块需要用到正则表达式(pcre 库) yum install pcre pcre-devel # 某些 content-type 响应时候可以进行压缩 `gzip on`(zlib 库) # 错误提示: `error: the HTTP gzip module requires the zlib library` yum install -y zlib yum install -y zlib-devel # 编译需要(gcc 库) yum install gcc gcc-c++ # MD5,SHA1 的散列函数,https 的 SSL 协议传输 http 需要(OpenSLL 库) # 错误提示:`./configure: error: SSL modules require the OpenSSL library` yum install openssl openssl-devel 执行 configure # 执行以下命令 # --with-http_ssl_module 代表开启 https 功能 # --with-http_stub_status_module 代表性能统计模块,可以统计一些请求的情况; ./configure --prefix=/usr/local/nginx/ \ --with-http_stub_status_module \ --with-http_ssl_module 执行 make,如果提示提示 nginx: [emerg] the maximum number of files supported by select() is 64,表示 FD_SETSIZE 的值比 nginx 配置文件中 worker_connections 指令所指定的值小,你可以把 nginx. conf 里的 worker_connections 选项改小一些,比如改为 30 就好了。 make 执行 make install make install
2022年05月15日
314 阅读
0 评论
0 点赞
2022-05-12
Nginx配置禁止目录或文件访问教程
配置要求 /install开头的目录禁止访问 /var开头的目录禁止访问 /usr/plugins开头的目录禁止访问 /usr/themes/目录下的.php后缀文件禁止访问 config.inc.php文件禁止访问 install.php文件禁止访问 配置文件 location ~* ^/(install/|var/|usr/plugins/|usr/themes/.*\.(php)$|config.inc.php|install.php){ deny all; }
2022年05月12日
418 阅读
0 评论
0 点赞