iis服务器助手广告广告
返回顶部
首页 > 资讯 > 服务器 >1. Nginx 基本功能配置
  • 792
分享到

1. Nginx 基本功能配置

nginx运维服务器 2023-10-10 09:10:41 792人浏览 薄情痞子
摘要

Nginx 目录信息 图 为 windows 版本的。 进入Nginx的主目录我们可以看到这些文件夹 client_body_temp conf fastcgi_temp html logs pr

Nginx 目录信息

图 为 windows 版本的。

在这里插入图片描述

进入Nginx的主目录我们可以看到这些文件夹

client_body_temp conf fastcgi_temp html logs proxy_temp sbin scgi_temp uwsgi_temp

其中这几个文件夹在刚安装后是没有的,主要用来存放运行过程中的临时文件

client_body_temp fastcgi_temp proxy_temp scgi_temp

目录信息:

conf

用来存放配置文件相关 , 主要关注 nginx.conf

在这里插入图片描述

html

用来存放静态文件的默认目录 html、CSS

在这里插入图片描述

sbin

nginx的主程序

logs

存放日志信息

nginx.conf 默认配置

#user  nobody;worker_processes  1;#error_log  logs/error.log;#error_log  logs/error.log  notice;#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {    worker_connections  1024;}Http {    include       mime.types;    default_type  application/octet-stream;    #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  logs/access.log  main;    sendfile        on;    #tcp_nopush     on;    #keepalive_timeout  0;    keepalive_timeout  65;    #gzip  on;    server {        listen       80;        server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;        location / {            root   html;            index  index.html index.htm;        }        #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$ {        #    root           html;        #    fastcgi_pass   127.0.0.1:9000;        #    fastcgi_index  index.php;        #    fastcgi_param  SCRIPT_FILENAME  /scripts$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;        #}    }    # another virtual host using mix of IP-, name-, and port-based configuration    #    #server {    #    listen       8000;    #    listen       somename:8080;    #    server_name  somename  alias  another.alias;    #    location / {    #        root   html;    #        index  index.html index.htm;    #    }    #}    # https server    #    #server {    #    listen       443 ssl;    #    server_name  localhost;    #    ssl_certificate      cert.pem;    #    ssl_certificate_key  cert.key;    #    ssl_session_cache    shared:SSL:1m;    #    ssl_session_timeout  5m;    #    ssl_ciphers  HIGH:!aNULL:!MD5;    #    ssl_prefer_server_ciphers  on;    #    location / {    #        root   html;    #        index  index.html index.htm;    #    }    #}}

基本运行原理

在这里插入图片描述

Nginx 配置使用

配置语法

nginx.conf 结构图可以这样概括:

main        # 全局配置,对全局生效├── events  # 配置影响 Nginx 服务器或与用户的网络连接├── http    # 配置代理,缓存,日志定义等绝大多数功能和第三方模块的配置│   ├── upstream # 配置后端服务器具体地址,负载均衡配置不可或缺的部分│   ├── server   # 配置虚拟主机的相关参数,一个 http 块中可以有多个 server 块│   ├── server│   │   ├── location  # server 块可以包含多个 location 块,location 指令用于匹配 uri│   │   ├── location│   │   └── ...│   └── ...└── ...

一个 Nginx 配置文件的结构就像 nginx.conf 显示的那样,配置文件的语法规则:

配置文件由指令与指令块构成;每条指令以 ; 分号结尾,指令与参数间以空格符号分隔;指令块以 {} 大括号将多条指令组织在一起;include 语句允许组合多个配置文件以提升可维护性;使用 # 符号添加注释,提高可读性;使用 $ 符号使用变量;部分指令的参数支持正则表达式

Nginx 的典型配置:

user  nginx;                        # 运行用户,默认即是nginx,可以不进行设置worker_processes  1;                # Nginx 进程数,一般设置为和 CPU 核数一样error_log  /var/log/nginx/error.log warn;   # Nginx 的错误日志存放目录pid        /var/run/nginx.pid;      # Nginx 服务启动时的 pid 存放位置events {    use epoll;     # 使用epoll的I/O模型(如果你不知道Nginx该使用哪种轮询方法,会自动选择一个最适合你操作系统)    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;   # Nginx访问日志存放位置    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;   # 默认文件类型    include /etc/nginx/conf.d/*.conf;   # 加载子配置项        server {    listen       80;       # 配置监听的端口    server_name  localhost;    # 配置的域名        location / {    root   /usr/share/nginx/html;  # 网站根目录    index  index.html index.htm;   # 默认首页文件    deny 172.168.22.11;   # 禁止访问的ip地址,可以为all    allow 172.168.33.44; # 允许访问的ip地址,可以为all    }        error_page 500 502 503 504 /50x.html;  # 默认50x对应的访问页面    error_page 400 404 error.html;   # 同上    }}

在这里插入图片描述

参考链接: https://www.nginx.org.cn/article/detail/545

html 404 配置

html 目录下 默认有 index.html 和 50x.html 页面

输入网址: http://localhost/

在这里插入图片描述

添加 404 页面

输入一个不存在的网址: http://localhost/yjl.html

在这里插入图片描述

![image.png](https://img-blog.csdnimg.cn/img_convert/c809e9c1f87b8690c05ee812b35cb311.png#averageHue=#fdfcfc&clientId=u06b3cd56-2022-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=704&id=u99027495&margin=[object Object]&name=image.png&originHeight=704&originWidth=1212&originalType=binary&ratio=1&rotation=0&showTitle=false&size=58266&status=done&style=none&taskId=uf3f02fd5-567c-41b9-8261-f86603ce906&title=&width=1212)

将 #error_page 404 /404.html; 放开 , 并且在 html 页面 编写一个 404.html 信息

在这里插入图片描述

再访问网址: http://localhost/yjl.html

在这里插入图片描述

404 跳转到 50x.html

在这里插入图片描述

在这里插入图片描述

404 跳转到首页

  location / {            root   html;            index  index.html index.htm;# 试图访问某个文件, 如果在 就使用原文件,如果不在,就用  /index.htmltry_files $uri $uri/ /index.html;        }

再访问网址: http://localhost/yjl.html , 跳转到 index.html 页面

![image.png](https://img-blog.csdnimg.cn/img_convert/4c36bcfbf2af654483bc6cd0427c507a.png#averageHue=#fbf9f8&clientId=u06b3cd56-2022-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=306&id=u60d41810&margin=[object Object]&name=image.png&originHeight=306&originWidth=1100&originalType=binary&ratio=1&rotation=0&showTitle=false&size=26131&status=done&style=none&taskId=u427bc03D-104d-456c-b7c5-5dab76c096e&title=&width=1100)

html 页面配置

往 html 页面里面放置一个 js 项目 Stock_Page, 那么访问时可以:

在这里插入图片描述

http://localhost/Stock_Page/page.html

在这里插入图片描述

root 配置静态资源

上面是将 Stock_Page 项目放置在 html 目录下, 实际应用中,一般都是将 项目 单独放置, 不放置在 html 下。 进行动态的配置。

Stock_Page 放置在 目录 : C:\Users\20481\Downloads\nginx-1.22.1
在这里插入图片描述

    location /Stock_Page {root C:\\Users\\20481\\Downloads\\nginx-1.22.1;index page.html page.htm;}        location / {            root   html;            index  index.html index.htm;# 试图访问某个文件, 如果在 就使用原文件,如果不在,就用  /index.htmltry_files $uri $uri/ /index.html;        }

输入 网址 : http://localhost/Stock_Page/page.html 可以查看页面

使用 root 时, 是 location /访问地址 , 对应的 就是 文件夹名, 这两个要一一对应。

alias 配置静态资源

location /Stock_Page {root C:\\Users\\20481\\Downloads\\nginx-1.22.1;index page.html page.htm;}location /Stock {alias C:\\Users\\20481\\Downloads\\nginx-1.22.1\\Stock_Page;index page.html page.htm;}        location / {            root   html;            index  index.html index.htm;# 试图访问某个文件, 如果在 就使用原文件,如果不在,就用  /index.htmltry_files $uri $uri/ /index.html;        }

使用 alias 时 , location /网址 只是一个引入, alias 会找真实的地址路径。

http://localhost/Stock/page.html

即可以访问信息。

root 和 alias 的区别:

root用来设置根目录,而alias在接受请求的时候在路径上不会加上location

1)alias指定的目录是准确的,即location匹配访问的path目录下的文件直接是在alias目录下查找的;
2)root指定 的目录是location匹配访问的path目录的上一级目录,这个path目录一定要是真实存在root指定目录下的;
3)使用 alias标签的目录块中不能使用rewrite的break(具体原因不明);
另外,alias指定的目录后面必须要加上"/“符 号!!
4)alias虚拟目录配置中,location匹配的path目录如果后面不带”/“,
那么访问的url地址中这个path目录后 面加不加”/“不影响访问,访问时它会自动加上”/“;
但是如果location匹配的path目录后面加上”/“,那么访问的url地 址中这个path目录必须要加上”/“,
访问时它不会自动加上”/“。如果不加上”/“,访问就会失败!
5)root目录配置 中,location匹配的path目录后面带不带”/",都不会影响访问。

配置静态资源

location ~ ^/(images|js|css|flash|media|static)/ {    root C:\\Users\\20481\\Downloads\\nginx-1.22.1\\staticFile;    #过期30天,静态文件不怎么更新,过期可以设大一点,如果频繁更新,则可以设置得小一点。    expires 30d;}

配置动态反向代理

location /Stockapi {    # 把 /stock 路径下的请求转发给真正的后端服务器    rewrite  ^/(.*)$ /$1 break;    proxy_pass http://127.0.0.1:8088$request_uri;    fastcgi_buffers 8 128k;    send_timeout 60;    client_max_body_size     100m;}

这样,访问 /StockApi/user/1 /StockApi/stock/002415
就可以访问到对应的后端接口请求信息。

location 配置规则

使用一个location 使用正则 location 前缀
/ 通用匹配,任何请求都会匹配到。
= 精准匹配,不是以指定模式开头
~ 正则匹配,区分大小写
~* 正则匹配,不区分大小写
^~ 非正则匹配,匹配以指定模式开头的location

location匹配顺序:

多个正则location直接按书写顺序匹配,成功后就不会继续往后面匹配

普通(非正则)location会一直往下,直到找到匹配度最高的(最大前缀匹配)

当普通location与正则location同时存在,如果正则匹配成功,则不会再执行普通匹配

所有类型location存在时,“=”匹配 > “^~”匹配 > 正则匹配 > 普通(最大前缀匹配)

配置负载均衡

upstream myproxy{server localhost:8088;server 127.0.0.1:8088;  }    server {        listen       80;        server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;location /StockApi {# 把 /stock 路径下的请求转发给真正的后端服务器rewrite  ^/(.*)$ /$1 break;proxy_pass http://myproxy$request_uri;fastcgi_buffers 8 128k;send_timeout 60;client_max_body_size     100m;}}

负载均衡配置权重

upstream myproxy{server localhost:8088 weight = 10 down;server 127.0.0.1:8088 weight = 1; server 192.168.100.54:8088 weight = backup; }

down:表示当前的server暂时不参与负载

weight:默认为1.weight越大,负载的权重就越大。

backup: 其它所有的非backup机器down或者忙的时候,请求backup机器。

upstream myproxy{server localhost:8088 weight = 10 down;server 127.0.0.1:8088 weight = 10 max_fails=5 fail_timeout=10s; server 127.0.0.1:8088 weight = 10 max_fails=5 fail_timeout=10s; server 192.168.100.54:8088 weight = backup; }

参考链接: https://blog.csdn.net/LL845876425/article/details/97621365

rewrite 使用

rewrite语法格式及参数语法:

rewrite是实现URL重写的关键指令,根据regex (正则表达式)部分内容, 重定向到replacement,结尾是flag标记。

rewrite [flag];

关键字 正则 替代内容 flag标记

关键字:其中关键字error_log不能改变

正则:perl兼容正则表达式语句进行规则匹配

替代内容:将正则匹配的内容替换成replacement

flag标记:rewrite支持的flag标记

rewrite参数的标签段位置:

server,location,if

flag标记说明:

last #本条规则匹配完成后,继续向下匹配新的location URI规则
break #本条规则匹配完成即终止,不再匹配后面的任何规则
redirect #返回302临时重定向,浏览器地址会显示跳转后的URL地址
permanent #返回301永久重定向,浏览器地址栏会显示跳转后的URL地址

实例

rewrite ^/([0-9]+).html$  /index.jsp?pageNum=$1 break;

$1 表示正则匹配符合的 第一个值。

如 请求信息匹配, 后端接口请求:

  location /StockApi {                # 把 /stock 路径下的请求转发给真正的后端服务器                rewrite  ^/(.*)$ /$1 break;                proxy_pass http://127.0.0.1:8088$request_uri;                fastcgi_buffers 8 128k;                send_timeout 60;                client_max_body_size     100m;        }

/StockApi 后面所有的信息, 当成一个参数 /$1

参考链接: https://blog.csdn.net/LL845876425/article/details/100999186

在这里插入图片描述

在这里插入图片描述

域名跳转

在这里插入图片描述

rewrite ^/(.*) http://www.yueshushu.top/$1 permanent;rewrite ^/(.*) http://www.yueshushu.top/$1 redirect;

post 请求方法跳转

在这里插入图片描述

return 307 http://www.yueshushu.top/$request_uri;return 308 http://www.yueshushu.top/$request_uri;

try_files 匹配规则

寻找某个路径, 如果存在,则使用原路径, 如果不存在,则使用新的路径。

如 html 404 配置中, 如果路径不存在,则跳转到首页

 try_files $uri $uri/ /index.html;

如果不存在,则 找默认的图片

 try_files $uri   $uri/  /images/loGo.jpg; 

配置 html 带不带均可以访问

如访问路径 , 有一个路径 /dev/md5.html, 希望访问 /dev/md5 可以请求到, /dev/md5.html 也可以请求到

可以这么配置

try_files $uri $uri/ $uri.html u r i . p h p uri.php uri.phpis_args$query_string;

location /dev {        try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;        root /etc/nginx;            index index.html index.htm;        }

防盗链配置

访问 : https://www.yueshushu.top/logo.jpg

在这里插入图片描述

请求头不携带任何信息都可以访问

valid_referers none | blocked | server_names | strings …;

none, 检测 Referer 头域不存在的情况。
blocked,检测 Referer 头域的值被防火墙或者代理服务器删除或伪装的情况。这种情况该头域的值不以 “http://” 或 “https://” 开头。
server_names ,设置一个或多个 URL ,检测 Referer 头域的值是否是这些 URL 中的某一个。

            valid_referers *.yueshushu.top www.yueshushu.top *.baidu.com *.google.com;                if ($invalid_referer) {                        return 403;                }

只允许 这几个访问: *.yueshushu.top www.yueshushu.top *.baidu.com *.google.com;

注意, Referer 时, 请求值 要加上协议。

location / {                root html;                index  index.html index.htm;                valid_referers *.yueshushu.top www.yueshushu.top *.baidu.com *.google.com;                if ($invalid_referer) {                        return 403;                }                try_files $uri $uri/ /index.html;        }

再次请求时:

在这里插入图片描述

在这里插入图片描述

配置 https 443 端口访问

免费申请一个证书, 下载 nginx 版本的

在这里插入图片描述

使用到 域名.key 域名_bundle.crt 两个证书

上传到 /etc/nginx/ssl/Nginx 目录下

在这里插入图片描述

进行配置:

server {listen       443 ssl;server_name  www.yueshushu.top;ssl_certificate   /etc/nginx/ssl/Nginx/1_www.yueshushu.top_bundle.crt;ssl_certificate_key  /etc/nginx/ssl/Nginx/2_www.yueshushu.top.key;    # 其它的配置信息}

如此即可.

配置 https 和 http 均可以访问

访问 http 时,会跳转到 https 协议地址

# 将Http请求转化成Https请求server {  listen 80;  server_name www.yueshushu.top;  rewrite ^/(.*) https://$server_name$request_uri? permanent;}

配置多个虚拟服务器

在实际业务中, 常常 有多个 前端项目, 每个项目可能存在多个分支, 可这些分支拥有着相同的请求路径, 如 都是 /StockApi , 这个时候,在同一个 server 下配置就不好了。 更不应该 复制多个 nginx ,每一个 nginx 跑一个项目。

实际上,对 单个 nginx 可以配置多个虚拟服务器, 拥有着不同的端口号, 这样就可以给不同的项目使用了。

端口号 listen 和 前端 路径 不同 alias

server {listen       8027;server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;location /StockApi {# 把 /stock 路径下的请求转发给真正的后端服务器rewrite  ^/(.*)$ /$1 break;proxy_pass http://myproxy$request_uri;fastcgi_buffers 8 128k;send_timeout 60;client_max_body_size     100m;}location ~ ^/(images|js|css|flash|media|static)/ {root C:\\Users\\20481\\Downloads\\nginx-1.22.1\\staticFile;#过期30天,静态文件不怎么更新,过期可以设大一点,如果频繁更新,则可以设置得小一点。expires 30d;}location /Stock {alias C:\\Users\\20481\\Downloads\\nginx-1.22.1\\Stock_Page;index page.html page.htm;}        location / {            root   html;            index  index.html index.htm;# 试图访问某个文件, 如果在 就使用原文件,如果不在,就用  /index.htmltry_files $uri $uri/ /index.html;        }    }server {listen       8081;server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;location /StockApi {# 把 /stock 路径下的请求转发给真正的后端服务器rewrite  ^/(.*)$ /$1 break;proxy_pass http://myproxy$request_uri;fastcgi_buffers 8 128k;send_timeout 60;client_max_body_size     100m;}location ~ ^/(images|js|css|flash|media|static)/ {root C:\\Users\\20481\\Downloads\\nginx-1.22.1\\staticFile;#过期30天,静态文件不怎么更新,过期可以设大一点,如果频繁更新,则可以设置得小一点。expires 30d;}location /Stock {alias C:\\Users\\20481\\Downloads\\nginx-1.22.1\\CainiaoStock_Page;index page.html page.htm;}        location / {            root   html;            index  index.html index.htm;# 试图访问某个文件, 如果在 就使用原文件,如果不在,就用  /index.htmltry_files $uri $uri/ /index.html;        }    }server {listen       8082;server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;location /StockApi {# 把 /stock 路径下的请求转发给真正的后端服务器rewrite  ^/(.*)$ /$1 break;proxy_pass http://myproxy$request_uri;fastcgi_buffers 8 128k;send_timeout 60;client_max_body_size     100m;}location ~ ^/(images|js|css|flash|media|static)/ {root C:\\Users\\20481\\Downloads\\nginx-1.22.1\\staticFile;#过期30天,静态文件不怎么更新,过期可以设大一点,如果频繁更新,则可以设置得小一点。expires 30d;}location /Stock {alias C:\\Users\\20481\\Downloads\\nginx-1.22.1\\yjlStock_Page;index page.html page.htm;}        location / {            root   html;            index  index.html index.htm;# 试图访问某个文件, 如果在 就使用原文件,如果不在,就用  /index.htmltry_files $uri $uri/ /index.html;        }    }

servername匹配规则 我们需要注意的是servername匹配分先后顺序,
写在前面的匹配上就不会继续往下匹配了。

完整匹配 我们可以在同一servername中匹配多个域名 server_name vod.mmban.com www1.mmban.com;

通配符匹配 server_name *.mmban.com

通配符结束匹配 server_name vod.*;

正则匹配 server_name ~1+.mmban.com$;

跨域 cors 配置

在浏览器上当前访问的网站向另一个网站发送请求获取数据的过程就是跨域请求。

跨域是浏览器的同源策略决定的,是一个重要的浏览器安全策略,用于限制一个 origin 的文档或者它加载的脚本与另一个源的资源进行交互,它能够帮助阻隔恶意文档,减少可能被攻击的媒介,可以使用 CORS 配置解除这个限制。

关于跨域网上已经有很多解释,这里就不啰嗦,也可以直接看 MDN 的 <浏览器的同源策略> 文档进一步了解,这里就列举几个同源和不同元的例子,相信程序员都能看得懂。

# 同源的例子http://example.com/app1/index.html  # 只是路径不同http://example.com/app2/index.htmlhttp://Example.com:80  # 只是大小写差异http://example.com# 不同源的例子http://example.com/app1   # 协议不同https://example.com/app2http://example.com        # host 不同http://www.example.comhttp://myapp.example.comhttp://example.com        # 端口不同http://example.com:8080

配置跨域:

server {listen       8027;server_name  localhost;  #允许跨域请求的域,* 代表所有      add_header 'Access-Control-Allow-Origin' *;      #允许带上cookie请求      add_header 'Access-Control-Allow-Credentials' 'true';      #允许请求的方法,比如 GET/POST/PUT/DELETE      add_header 'Access-Control-Allow-Methods' *;      #允许请求的header      add_header 'Access-Control-Allow-Headers' *;      # 省略配置 location }

参考链接: https://blog.csdn.net/qq_38011415/article/details/107095403

配置 真实的 IP 和端口

nginx 转发之后,后端获取的 IP地址等信息,是 nginx 所在服务器的 IP地址, 并不是 客户请求时的 IP地址。

    proxy_set_header Host $host:$server_port;            proxy_set_header X-Real-IP $remote_addr;            proxy_set_header X-Real-PORT $remote_port;            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

在具体的 location 下

location /StockApi {# 把 /stock 路径下的请求转发给真正的后端服务器proxy_set_header Host $host:$server_port;            proxy_set_header X-Real-IP $remote_addr;            proxy_set_header X-Real-PORT $remote_port;            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;rewrite  ^/(.*)$ /$1 break;proxy_pass http://myproxy$request_uri;fastcgi_buffers 8 128k;send_timeout 60;client_max_body_size     100m;}

配置成功。

配置开启 gzip

gzip on; # 默认off,是否开启gzipgzip_types text/plain text/css application/JSON application/x-javascript text/xml application/xml application/xml+rss text/javascript;# 上面两个开启基本就能跑起了,下面的愿意折腾就了解一下gzip_static on;gzip_proxied any;gzip_vary on;gzip_comp_level 6;gzip_buffers 16 8k;# gzip_min_length 1k;gzip_http_version 1.1;

在这里插入图片描述


  1. 0-9 ↩︎

来源地址:https://blog.csdn.net/yjltx1234csdn/article/details/128170526

--结束END--

本文标题: 1. Nginx 基本功能配置

本文链接: https://www.lsjlt.com/news/427084.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • 1. Nginx 基本功能配置
    Nginx 目录信息 图 为 windows 版本的。 进入Nginx的主目录我们可以看到这些文件夹 client_body_temp conf fastcgi_temp html logs pr...
    99+
    2023-10-10
    nginx 运维 服务器
  • Nginx常用配置及和基本功能讲解
    Nginx是一个高性能的Web服务器和反向代理服务器,常用于构建高可用、高并发的Web应用。下面是Nginx的常用配置及基本功能的讲...
    99+
    2023-09-20
    Nginx
  • Day 1-1 PHP-Nginx配置
    Day 1-1 PHP-Nginx配置 配置清单 操作系统:Windows 10数据库:MySQL 8后端编程语言:PHP 7.3(nts即可) PHP框架:Phalcon 3.4 容器:无(无D...
    99+
    2023-10-08
    php nginx 开发语言
  • 1 Nginx跨域配置
    跨域问题在之前的单体架构开发中,其实是比较少见的问题,除非是需要接入第三方SDK时,才需要处理此问题。但随着现在前后端分离、分布式架构的流行,跨域问题也成为了每个Java开发必须要懂得解决的一个问题。 跨域问题产生的原因    产生跨域问题...
    99+
    2023-09-05
    java 开发语言
  • Nginx安装后常用功能配置基础篇
    目录1.主配置文件与虚拟主机分离利用server模块创建www和bbs两个虚拟站点2.虚拟主机别名设置3.Nginx status状态信息配置4.增加错误日志1.主配置文件与虚拟主机...
    99+
    2022-11-13
  • Nginx基础location语法及功能配置实例
    目录1.Nginx location1.1.location作用1.2.location语法1.3.location匹配示例1.4.location配置实例1.5.不用uri及特殊字...
    99+
    2022-11-13
  • Nginx配置文件nginx.conf的基本配置实例详解
    目录前言1. Nginx配置样例2. Nginx负载均衡方式2.1 轮询2.2 权重2.3 Nginx解决集群共享session问题的方案3. Nginx动静分离(静态资源...
    99+
    2022-11-13
  • Nginx的location功能怎么配置
    本篇内容介绍了“Nginx的location功能怎么配置”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!Nginx location 1.1....
    99+
    2023-06-29
  • nginx本地配置https
    WIN10环境Nginx配置本地项目HTTPS 安装chocolatey 管理员身份打开cmd 在cmd窗口运行以下命令 @"%SystemRoot%\System32\WindowsPo...
    99+
    2023-09-13
    nginx https php
  • Nginx安装后常用功能如何配置
    这篇文章主要介绍“Nginx安装后常用功能如何配置”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Nginx安装后常用功能如何配置”文章能帮助大家解决问题。1.主配置文件与虚拟主机分离如果虚拟主机很多...
    99+
    2023-06-29
  • 阿里云ECS服务器配置Nginx的基本步骤
    Nginx是一款非常优秀的Web服务器,广泛应用于各种场合,包括但不限于网站服务器、反向代理、负载均衡等。在阿里云ECS服务器上配置Nginx,不仅可以提高服务器的效率,也可以保证网站的稳定性和安全性。本文将详细解释如何在阿里云ECS服务器...
    99+
    2023-11-10
    阿里 服务器配置 步骤
  • Nginx与PHP基本运行原理与fpm常见配置
    一次Web请求的处理流程 名词解释 php常用配置 php.ini(php) php-fpm FPM(FastCGI 进程管理器)是 PHP FastCGI 的主要实现,包含大部分对高负载网站有用的功能。 它的功能包括: 支持平...
    99+
    2023-10-10
    nginx php
  • Nginx如何配置文件分段下载功能
    这篇文章主要为大家展示了“Nginx如何配置文件分段下载功能”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Nginx如何配置文件分段下载功能”这篇文章吧。Htm...
    99+
    2022-10-19
  • H3C基本配置
    一、基本配置pc1配置 <h3c>system-view[h3c]sysname pc1[h3c]int g0/0[pc1-GigabitEthernet0/0]ip add 192.168.2.100 255.255.25...
    99+
    2023-01-31
    基本配置 H3C
  • redis基本配置
    1.下载编译安装cd /usr/srcwget http://download.redis.io/releases/redis-3.2.3.tar.gztar -xf redis-3.2...
    99+
    2022-10-18
  • Nginx常用的基础配置方案
    本篇内容主要讲解“Nginx常用的基础配置方案”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Nginx常用的基础配置方案”吧!Nginx的fastcgi模块参数设置Nginx 有两个配置文件fa...
    99+
    2023-06-04
  • php-fpm基本配置
    php配置文件: php.ini: display_errors = Off #关闭错误提示 expose_php = Off #隐藏php版本 #禁用危险函数,禁用之后composer 会有问题,使用composer的请单独配置禁用函数...
    99+
    2023-09-23
    php 开发语言 服务器
  • ospfv3的基本配置
     R1     #ipv6 unicast-routing     #int s1/1     #ipv6 address 2002::1:1/122     #ipv6 ospf 1 area 0     #no shutdown    ...
    99+
    2023-01-31
    基本配置
  • MySQL的基本配置
    本篇内容介绍了“MySQL的基本配置”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!query_cache_...
    99+
    2022-10-18
  • Python OpenGL基本配置
    参考:http://pyopengl.sourceforge.net 一、pip 安装 PyOpenGL pip install PyOpenGL PyOpenGL_accelerate 二、测试代码 from OpenGL....
    99+
    2023-01-31
    基本配置 Python OpenGL
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作