Nginx使用及配置整理

ArcGIS中如何计算多个点到特定线的最短距离 现有一个点图层和一个面图层,怎么来计算这些点到这个面图层,两个面的公共边的最短直线距离呢? 1.首先得将两个图层都转为 投影坐标系 打开工具箱-数据管理工具-要素-面转线 ​ ​ 2.将面图层设为输入要素 注意要将“识别和存储面邻域信息”勾选 ​ 3.面转线成功后 打开线属性表,线图层拥有了 LEFT_FID和RIGHT_FID两个字段 ​ 4.按属性选择,表达式中输入 “LEFT_FID”<>-1 即可选出两个面的公共边 ​再将选... 阅读详情

nginx操作命令

  • 进入到Nginx的安装目录: cd /xx/nginx/sbin/
./nginx
  • 停止命令:
./nginx -s stop
./nginx -s quit
  • 重新加载配置信息
./nginx -s reload
  • 查看nginx版本
./nginx -version
  • 测试nginx状态
./nginx -t

Nginx语法详解

语法规则: location [=|~|~*|^~|!~|!~*] /uri/ { … }

= 开头表示精确匹配

^~ 开头表示uri以某个常规字符串开头,理解为匹配 url路径即可。nginx不对url做编码,因此请求为/static/20%/aa,可以被规则^~ /static/ /aa匹配到(注意是空格)。以xx开头

~ 开头表示区分大小写的正则匹配 以xx结尾

~* 开头表示不区分大小写的正则匹配 以xx结尾

!~和!~*分别为区分大小写不匹配及不区分大小写不匹配 的正则

/ 通用匹配,任何请求都会匹配到。

Nginx命令介绍

  • root命令
    • 指定静态资源目录位置,它可以写在 http 、 server 、 location 等配置中。
root path

例如:

location /image {
 root /opt/nginx/static;
}

当用户访问 www.test.com/image/1.png 时,实际在服务器找的路径是 /opt/nginx/static/image/1.png
[注意] root 会将定义路径与 URI 叠加, alias 则只取定义路径。

  • alias命令
    • 它也是指定静态资源目录位置,它只能写在 location 中。
location /image {
 alias /opt/nginx/static/image/;
}

当用户访问 www.test.com/image/1.png 时,实际在服务器找的路径是 /opt/nginx/static/image/1.png
[注意] 使用 alias 末尾一定要添加 / ,并且它只能位于 location 中。

Nginx配置动静分离

# 所有静态请求都由nginx处理,存放目录为html  
  location ~* \.(gif|jpg|jpeg|png|bmp|swf|css|js)$ {  
      root    e:wwwroot;  
  }  

  # 所有动态请求都转发给tomcat处理  
  location ~ \.(jsp|do)$ {  
      proxy_pass  http://test;
  }  
  • Nginx中的proxy_pass

  • 分两类:

    • 1)只包含IP和端口号,端口号之后无/,成为不带URI的方式;
    • 2)端口号之后有其它路径,分两类:只有单个/,其他路径;
  • Nginx反向代理

    • 反向代理就是后端服务不直接对外暴露,请求首先发送到nginx,然后nginx将请求转发到后端服务器,比如tomcat php等.如果后端服务只有一台服务器,nginx在这里只有一个作用就是起到了代理后端服务接收请求的作用.称之为反向代理.

Nginx中映射前端访问URL的规则

1)例如:/export/test/platform/目录下存在abc文件夹,Nginx中的配置信息为:

location ^~/ {
            root /export/test/platform/;
            index  index.html index.htm;
}

前端访问路径为:http://<服务器IP地址或域名>/abc时,会访问/export/test/platform/目录下的abc。

Nginx配置示例

server {
  listen 80;
  server_name www.test.com;
  
  # 只有当访问 www.test.com/match_all/ 时才会匹配到/usr/share/nginx/html/match_all/index.html
  location = /match_all/ {
      root /usr/share/nginx/html
      index index.html
  }
  
  # 当访问 www.test.com/1.jpg 等路径时会去 /usr/share/nginx/images/1.jpg 找对应的资源
  location ~ \.(jpeg|jpg|png|svg)$ {
   root /usr/share/nginx/images;
  }
  
  # 当访问 www.test.com/bbs/ 时会匹配上 /usr/share/nginx/html/bbs/index.html
  location ^~ /bbs/ {
   root /usr/share/nginx/html;
    index index.html index.htm;
  }
}

欢迎关注我的微信公众号ItBeeCoder

在这里插入图片描述

python基于pingouin统计分析:rm_corr计算两个变量之间的重复测量相关性(Repeated measures correlation、plot_rm_corr函数可视化重复测量相关性图 python基于pingouin包进行统计分析:使用rm_corr函数计算两个变量之间的重复测量相关性(Repeated measures correlation)、plot_rm_corr函数可视化重复测量相关性图 阅读详情

相关推荐

Spring Boot 实现多图片上传并回显,涨姿势了~

上传 Controller的代码非常简单,由于用了SpringMVC框架,所以直接用MultipartFile来接即可。由于是多图片上传所以用数组来接。此处应该注意参数名应该和<input>中的name值相对应: @RequestMapping("/pic") @ResponseBody publicResponseEntity<String>pic(MultipartFile[]pictures)throwsException{ ResponseEnti...

weixin_54556126的博客 894

2020-11-27

前后端分离nginx 配置如下 location ~* .(jpg|gif|png|js|css)$ { root ***.html; } zzzzz的css等文件无法加载了: location ~/zzzz/.*\.(woff|ttf|jpg|gif|png|js|css)$ { root ***.html; } 就可以了 location语法规则:location[=|~|~*|^~]/uri/{…} =开头表示精确匹配 ^~开头表示uri以某个常规字...

q_zedong的博客 248

睿思综述智能体:100篇高质量文献一键生成万字长文,还能联网PubMed,科研效率拉满!

对一个主题进行文献综述,是日常科研人绕不过去的工作,无论是写论文前言,综述论文,或者基金申请书的立项依据,需要根据主题,从海量文献中提取相关信息,梳理出清晰的逻辑线,再组织成流畅的文字。4 一键生成万字全文:大纲确认后,它会基于对所有论文的深度理解,逐个章节进行详细撰写,最终生成一篇逻辑连贯、内容翔实、引用规范的万字综述长文,并直接保存为Word(.docx)文件。3 智能撰写大纲:你可以提供自己的大纲,也可以让它根据所有文献内容,智能生成一个逻辑清晰的综述大纲,并支持你在此基础上修改。

dinaxuejie的博客 821

nginx 详解

nginx 详解

很久很久以前的的博客 3879

3.ESP32S3 AP 配网开发实战:HTTP 与 WebSocket 协议实现

本文介绍了基于ESP32S3的AP配网实现方案,通过HTTP协议提供配网网页,利用WebSocket实现双向通信。详细解析了HTTP和WebSocket协议特点,阐述了SPIFFS文件系统存储HTML网页的方法,包括分区表配置、CMakeLists设置和代码实现。工程采用模块化设计,包含WiFi管理、Web服务器、IO扩展等组件,支持手机浏览器直接配网。测试验证了从AP热点连接到路由器切换的全流程,并总结了SPIFFS操作、WebSocket通信等核心优化点。该方案无需专用APP,适合物联网设备快速部署场景

u011697185的专栏 961

本地如何安装midscene.js运行环境

手把手教你本地安装midscene.js运行环境

实践助梦想成长 2610

nginx配置详解

https://www.cnblogs.com/knowledgesea/p/5175711.html

yun914的博客 324

vscode运行.ipynb代码时提示需要安装ipykernel包的解决办法

此文目的是为了记录遇到的一些问题,也希望能帮助到和我一样遇到困难的同学。如需转载,请注明出处。在使用vscode运行.ipynb文件中提示需要安装ipykernel包的提示,在网上查询了很多方法之后也是终于解决了问题。写下这篇博客也希望能帮到大家。

qq_58018041的博客 4万+

Nginx笔记(二)Nginx配置实例

Nginx配置实例 反向代理 实现的效果 打开浏览器,在浏览器地址栏中输入地址www.123.com ,跳转到Linux系统的Tomcat主页面中。 准备工作 安装Tomcat和JDK 安装JDK 启动Tomcat 默认8080端口没开,需要手动对外开放 分析过程 Windows的host文件: 在Nginx中配置反向代理的设置 反向代理2 实现的效果: 使用Nginx...

- 647

A100 NVLink集群极致优化指南

《A100 NVLink集群通信优化指南》摘要:针对A100 80G SXM机型NVLink 3.0集群,提供硬件配置检查方法(nvidia-smi topo -m)和强制启用指令。重点介绍NCCL参数调优(算法选择、低延迟协议配置)、GPUDirect RDMA启用步骤,以及单机/多机场景下的通信模式选择。包含PyTorch all_reduce基准测试方法,并给出带宽异常排查方案(dmesg检查、NCCL缓存重置)。通过CUDA Graph通信重叠和混合精度优化,可实现90%+带宽利用率。附猿界算力监控

2401_89353317的博客 592

【图像去噪】基于梯度为0法实现图像去噪附matlab代码

近几年,徐立提出的 L0 梯度最小化模型在图像平滑领域得到了广泛的应用和发展[11]. 和以往的局部滤波模型不同的是该模型可以全局的估计图像的像素值,因此,L0 梯度最小化模型在处理图像的同时能够很好的保护图像的边缘.​。

qq_59747472的博客 186

Nginx Location配置总结

Nginx Location配置总结 十一 02 ToFishes服务器 No Comments 参考来源: http://blog.zol.com.cn/1067/article_1066186.html,http://flandycheng.blog.51cto.com/855176/280121 语法规则: location [=|~|~*|^~]...

weixin_34051201的博客 856

【EB_Tresos专题】-01-EB Tresos导入工程

<--返回「Autosar_BSW高阶配置」总目录--> <--返回「Autosar_BSW高阶配置」专栏主页--> <--返回「个人博客」首页--> <--返回「Autosar_BSW高阶配置」总目录--> <--返回「Autosar_BSW高阶配置」专栏主页--> <--返回「个人博客」首页--> 结尾 ...

「汽车电子助手」的博客 6439

我整理的一份来自于线上的Nginx配置(Nginx.conf),希望对学习Nginx的有帮助

我整理了一份Nginx的配置文件说明,是真正经历过正式线上考验过。如果有优化的地方,也请朋友们指点一二,整理出一份比较全而实用的配置。 主要包含配置:负载均衡配置,页面重定向,转发,HTTPS和HTTP的配置, 缓存优化,错误页面配置等。 #user nobody; #工作进程,于CPU核数一致 worker_processes 2; #error_log logs/error.log...

weixin_30767835的博客 149

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

nginx安装配置整理

最近整理笔记,把之前笔记上记的一些东西backup一下; 1、安装gcc环境及第三方库 安装环境:centos7.6 yum install gcc-c++ yum install -y pcre pcre-devel yum install -y zlib zlib-devel yum -y install pcre pcre-devel zlib zlib-devel openssl openssl-devel 2、下载并安装ngnix包 wget http://nginx.org/download

guofeng_hao的博客 363

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Nginx 配置整理

链接:nginx配置详细解析 1. C10k问题:无法同时并发超过(1w)客户端请求而出现的问题。   nginx默认配置超过1w并发; 2.配置文件conf/nginx.conf (1)user   www  www;   #定义Nginx运行的用户和用户组 (2)worker_processes 8;  #启动进程,通常设置成和cpu数量相等;(3)worker_cpu_affinity...

weixin_30907935的博客 138

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Nginx由于错误配置出现404页面及及其他踩坑点的简单整理

配置nginx的.conf文件时,会有一些容易踩坑的地方,即配置不当导致出现404页面,原因可能由root 及 alias 对文件路径的拼接,末尾的斜杠“/”有无,或者location uri匹配规则引起,以下简单整理了这些排错方法/

alicinya的博客 8652

分享:常见的 Nginx 配置选项整理

分享:常见的 Nginx 配置选项整理 常见的 Nginx 配置选项整理 http://my.oschina.net/sharelinux/blog/102301 ...

87

nginx常用配置整理

​1、使用nginx做反向代理 ​2、文件访问服务器(http)基本配置 ​3、作为vue项目的http服务器配置 1、使用nginx做反向代理基本配置方式 用到upstream 配置被代理的目标服务器,使用weiget属性配置 目标服务器的访问全职 在server下,使用proxy_pass去配置 upstream server{ listen 80; server_name 127.0.0.1 localhost; location / {

奋斗的足球狗的专栏 4042

Nginx日志配置整理

Nginx日志配置整理

云原生devsecops 1万+

Nginx Http配置整理

Nginx 支持 rewrite 功能。若您在编译时没有去掉 pcre,您可在 HTTP 的 server 中增加。由于版本问题,配置文件可能存在不同的写法。例如:Nginx 版本为。,即可将默认80端口的请求重定向为 HTTPS。未添加注释的配置语句,您按照下述配置即可。通过 Web 服务器实现跳转。在页面中添加 JS 脚本。在后端程序中添加重定向。

天马3798 762

nginx 常用配置整理

upstream tomcat_server { server 192.168.1.231:8080 weight=1; server 192.168.1.232:8080 weight=1; } location / { proxy_set_header Host $host; proxy_s...

zhaoyang10的专栏 472

整理过后的nginx配置详解

源文章https://blog.youkuaiyun.com/tjcyjd/article/details/50695922 源文章格式太难受了,自己整理了一下,给大家分享 # Nginx用户及组:用户 组。window下不指定 user nginx nginx ; # 工作进程:数目。 # 根据硬件调整,通常等于CPU数量或者2倍于CPU。 worker_processes 8; # 错误日志:存放路径。 error_log logs/error.log; error_log logs/error.log not

Apoca_lypse的博客 274

kohana框架nginx配置整理

kohana框架nginx配置整理vim nginx.conf vim nginx.conf server { listen 80; server_name qipa250.kohana.com; error_log /var/log/nginx/qipa250.kohana.com-error.log; rewrite_log on; # access_log logs/host.access.log mai

徊忆羽菲 284

Nginx配置文件报错整理

Nginx配置文件报错整理

目前日更2篇中,谢谢关注! 2025

Nginx基本安装及配置整理

基本安装 安装Nginx需要先安装pcre、zlib,如果需要ssl功能还需要安装openssl 一般需要先装pcre, zlib,前者为了重写rewrite,后者为了gzip压缩。 创建nginx用户 假设源码目录:/home/nginx/src/ 安装PCRE库 安装命令: cd /home/nginx/src/ tar -zxvf pcre-8.37.tar.gz cd pcre-8.37 ...

garmoo的博客 357
上一篇: 后端开发知识点整理汇总
下一篇: 容器化知识整理
It_BeeCoder
博客等级 码龄10年 967粉丝 238原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值