我目前有一个AngularJS应用程序运行在我的虚拟专用服务器上。 为了运行这个,我使用NGINX,Node和'http-server'和pm2来保持所有的运行。 所以我开始我的后端使用例如'node server.js'(端口3000),我设置了第二个'http-server'进程(我认为运行在端口8080)在公用文件夹中。 这是我的NGINX的configuration: server { listen 80; server_name mywebsite.be; location /{ proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://127.0.0.1:3000/; } } 现在我想要安装Angular(2)创build的第二个应用程序。 我试图在端口3001上运行我的后端节点,然后在端口8081上启动http-server。 我应该如何configuration我的NGINX?
pool: www process manager: dynamic start time: 22/Oct/2017:15:32:05 -0400 start since: 60605 accepted conn: 5169879 listen queue: 0 max listen queue: 0 listen queue len: 0 idle processes: 33 active processes: 8 total processes: 41 max active processes: 107 max children reached: 0 slow requests: 0 总过程,最大活动过程和最大孩子达到什么意思呢? 我怎么能从这些值了解服务器负载? 哪个值(例如)表示连接已满? 谢谢
我试图在RHEL 7.2机器上安装nginx,并且出现错误, Error: Package: 1:nginx-1.10.2-2.el7.x86_64 (epel) Requires: libcrypto.so.10(OPENSSL_1.0.2)(64bit) You could try using –skip-broken to work around the problem You could try running: rpm -Va –nofiles –nodigest 坚果这个libcrypto.so.10(OPENSSL_1.0.2)(64位)在默认的openssl软件包上不可用,所以我删除了当前的openssl软件包并使用rpm安装如下, [root@db-brm ~]# rpm -Uvh http://mirror.centos.org/centos/7/os/x86_64/Packages/openssl-libs-1.0.2k-8.el7.x86_64.rpm 我认为这将解决问题,但它没有和它增加了openssl的冲突,并给安装nginx时出错, 我可以看到这是错误, [root@db-brm ~]# yum install nginx Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. […]
这是我的sites-available/default Nginx文件。 正如你可以看到它包含我的默认设置,我的网站的设置。 server { server_name _; return 301 https://$host$request_uri; root /var/www/html; index index.php index.html index.htm; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass 127.0.0.1:9000; } location / { try_files $uri $uri/ =404; } location ~ /\.ht { deny all; } } server { listen 80; listen [::]:80; # 443 ssl http2; # [::]:443 ssl http2; […]
我目前有我的网上商店,通过1and1(我在那里买了域名),我们的后端是使用Nginx托pipe@Linux云服务器。 我们正在使用基本版本的Cloudflare作为前端。 现在,当我们使用“wildcard”ssl证书(GeoTrust)转换为https时,但我们无法获得redirect以使用CloudFlare CDN。 我曾与1and1支持,但我们还没有find一个解决scheme。 我希望Cloudflare上的某个人能够帮助解决scheme,但是没有回应。 从1and1(GeoTrust)购买了SSL证书,并在nginxconfiguration中进行了以下configuration listen 443 ssl; server_name abc.com; ssl_certificate /etc/nginx/ssl/abc.com_ssl_certificate.cer; ssl_certificate_key /etc/nginx/ssl/*.abc.com_private_key.key; 网站适用于以下条件 HTTP – > Cloudflare – > 1and1 – > Nginx(托pipe在云端服务器) HTTPS – > 1and1 – > Nginx(托pipe在云端服务器) 网站不工作 HTTPS – > Cloudflare – > 1and1 – > Nginx(托pipe在云端服务器)
slowlog = /var/log/php-fpm/slow.log request_slowlog_timeout = 1s 这下面两行是在PHPconfiguration文件中添加。 一旦添加并重新启动php-fpm,就会创buildslow.log文件。 (request: "GET /index.php") executing too slow (1.072177 sec), logging 这个错误显示在php-fpm的error.log文件中。 但没有额外的细节。 我无法跟踪哪个url导致麻烦。 这是codeigniter框架。 所以我在所有的方法上都使用了框架的基准testing工具,发现多次testing的执行速度快为0.004到0.01 slow.log可能是空的原因是什么? 有没有办法在错误日志中获得完整的url进程缓慢?
在Certbot更改其中一个Nginx的site-conf文件后,我在两个站点上遇到了错误的网关。 在nginx -t没有任何错误。 只有这个在tail /var/log/nginx/error.log : 连接到上游时,客户端:66.249.69.71,服务器:domain.tld1,请求:“GET连接()失败(111:连接被拒绝)时发送错误消息27439#27439: / category /%D7%9B%D7%9C%D7%9C%D7%99 / HTTP / 1.1“,上行:”fastcgi://127.0.0.1:9000“,主机:”contfix.co.il“root @ benqzq:〜# 只有这个在tail /var/log/nginx/access.log : 185.188.204.5 – [24 / Oct / 2017:15:44:13 +0000]“POST /xmlrpc.php HTTP / 1.0”499 0“ – ”“Mozilla / 4.0(compatible:MSIE 7.0; Windows NT 6.0)” 在nginx重置没有错误。 这是我使用Certbot更改的站点的站点configuration: server { root /var/www/html/contfix.co.il; server_name contfix.co.il www.contfix.co.il; location / { index index.php index.html […]
有可能使用2个url相同的网页例如: https://example.com/contact有内容blablabla,我们用nginx创build重写或屏蔽url,所以最终的输出是,当访问者点击https://example.com/contact2他们会看到与https://example.com/contact相同的内容https://example.com/contact 我试着用nginx重写,但显示的url是https://example.com/contact2不是我所期望的是https://example.com/contact 谢谢之前!
我不知道为什么,但有时我在nginx中得到这个错误。 有谁知道什么会产生这个错误? 2017/10/25 15:00:34 [crit] 5908#3228: *20789 SSL_write() failed (SSL:) (10053: FormatMessage() error:(15105)) while sending to client, client: 90.200.200.200, server: my.domain.com, request: "GET /faces/production.xhtml HTTP/1.1", upstream: "https://127.0.0.1:443/faces/production.xhtml", host: "my.domain.com", referrer: "https://my.domain.com/faces/production.xhtml" 另一个例子: 2017/10/25 15:05:40 [crit] 5908#3228: *21344 SSL_write() failed (SSL:) (10053: FormatMessage() error:(15105)) while sending to client, client: 90.300.300.300, server: my.domain.com, request: "GET /faces/javax.faces.resource/fa/fontawesome-webfont.ttf?ln=primefaces&v=5.2 HTTP/1.1", […]
我有一个奇怪的问题,我的nginx服务器 有时静态文件在10到20毫秒之间(完美),但有时可以达到1600毫秒 testing文件是一个3Kb的PNG图标 我testing本地和从另一台服务器 ab -k -c 100 -n 10000 https://www.some-url.com/icon.png 98%的请求没有出现这个问题,但是2%很慢 在一个真实的网页上,图片加载的平均时间为100Kb文件为500毫秒! (等待TTFB时间) 我不明白为什么这个随机性,任何帮助将不胜感激 我的nginxconfiguration: worker_processes 32; events { worker_connections 4096; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 3600; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/javascript application/x-javascript […]