我想要有一个速率限制代码与以下选项: 我正在使用CloudFlare,所以我希望它查找真正的IP地址。 我想要一个白名单选项 我想创build一个阻塞的IP地址列表(达到阈值的IP)的文件。 限速将是每2秒15个请求,类似的。 我发现这个答案: https : //serverfault.com/a/642357 它看起来不错,但它会寻找真正的IP地址? 我有这个代码: set_real_ip_from 103.21.244.0/22; set_real_ip_from 103.22.200.0/22; set_real_ip_from 103.31.4.0/22; set_real_ip_from 104.16.0.0/12; set_real_ip_from 108.162.192.0/18; set_real_ip_from 131.0.72.0/22; set_real_ip_from 141.101.64.0/18; set_real_ip_from 162.158.0.0/15; set_real_ip_from 172.64.0.0/13; set_real_ip_from 173.245.48.0/20; set_real_ip_from 188.114.96.0/20; set_real_ip_from 190.93.240.0/20; set_real_ip_from 197.234.240.0/22; set_real_ip_from 198.41.128.0/17; set_real_ip_from 199.27.128.0/21; set_real_ip_from 2400:cb00::/32; set_real_ip_from 2606:4700::/32; set_real_ip_from 2803:f800::/32; set_real_ip_from 2405:b500::/32; set_real_ip_from 2405:8100::/32; # use any of […]
我正在努力把TLS / SSL放在kubernetes的wordpress站点前面。 我前面有一个Ingress。 没有任何TLSconfiguration,我可以访问该网站好吧。 当我添加TLSconfiguration时,我访问该网站超时。 Ingress.yaml: apiVersion: extensions/v1beta1 kind: Ingress metadata: name: helloworld-rules spec: tls: – hosts: – mysite.com secretName: tls-secret rules: – host: mysite.com http: paths: – path: / backend: serviceName: mysite servicePort: 80 进入-controller.yaml: apiVersion: v1 kind: Service metadata: name: nginx-ingress labels: app: nginx-ingress spec: type: LoadBalancer ports: – port: 80 targetPort: […]
由于许多原因,我们不希望/不需要用户直接访问php。 其实我们的PHP后端大多服务于Restful API。 只有一小部分的代码服务于一些MVC网站。 如下所述 mywebsite.com/abcsomething.php – >阻止它(更难以破解?!) mywebsite.com/api/abc?xyz – > api.php(我们的API要点在这里) mywebsite.com/utility/abc?xyz – > utility.php(很好的老php代码) mywebsite.com/admin/abc?xyz – > admin / admin.php(很好的老php代码) mywebsite.com/everthing_else/something?xyz – > generated / index.html(everthing else作为单个页面的网站) 我们并没有真正的index.php,但很多php主要描述如上。 我已经search了近4天,但无法完成。 我到目前为止: … root /www/app; … location ~ \.php$ { deny all; } location ^~ /api { } location ^~ /utility { fastcgi_pass 127.0.0.1:9000; fastcgi_index […]
我正在尝试在AWS / Linux AMI上为django app和php设置nginx。 Nginx已经被configuration为同时为多个Django应用程序工作,所有的工作正常。 现在我需要包含基于php的第三方解决scheme。 这应该在单独的url/破折号/。 我经历了许多教程和“堆栈”的答案,但没有为我工作。 我已经安装了php和php-fpm。 我在/etc/php-fpm-5.5.d/www.conf修改了configuration文件,并尝试使用socket和TCP / IP: listen = 127.0.0.1:9000 并且 listen = /var/run/php-fpm.sock 重新启动php-fpm服务后,我检查了套接字是否真的被创build。 然后我相应地修改了nginx: location ~ /dash/$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; #fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/var/run/php-fpm.sock; fastcgi_index index.php; include fastcgi_params; } 我创build了test.php文件来testingphp,并且将第三方解决scheme放到了/ usr / share / nginx / html /中。 当我尝试访问https:// DOMAIN / dash /时,我得到了404错误(或者如果删除了try_files设置,我得到空白页面)。 但是,当我尝试访问https://DOMAIN/dash/index.php或https://DOMAIN/test.php时 […]
我正在重buildNGINX网站从sub.domain.com到domain.com/sub,我想dynamic地重写/redirect到domain.com/sub/sub2的所有sub.domain.com/sub2链接。 目前,我的重写规则只是将sub.domain.comredirect到domain.com/sub,而不是将sub.domain.com/sub2redirect到domain.com/sub/sub2。 server { server_name sub.domain.com; rewrite ^ $scheme://www.domain.com/sub$1 permanent; }
我有几个服务,最值得注意的是nginx和ntpd,这取决于正在工作的DNSparsing正确启动。 目前,这些服务都不能在启动时正确启动,但是一旦机器启动后手动干预就可以正常启动,日志中的某些消息不能parsing名称。 这导致我相信我正在与systemd竞争。 我的服务器指向名称服务器的127.0.0.1。 绑定到localhost:53是pdns-recursor。 我已经设置ntp和nginx在单元文件中被WantedBy pdns-recursor如下 [Unit] WantedBy=pdns-recursor.service 不过,我仍然在nginx和ntp中收到关于在启动时未能parsing名字的日志消息。 在这些服务尝试启动之前,如何validationDNS是否完全启动? 我正在使用Ubuntu 16.04 Aug 09 22:35:25 host.blah ntpd[3574]: restrict: ignoring line 21, address/host 'ntp.blah' unusable. Aug 09 22:35:26 host.blah ntpd[3574]: restrict: ignoring line 23, address/host 'ntp.blah' unusable. Aug 09 22:35:28 host.blah ntpd[3574]: restrict: ignoring line 25, address/host 'ntp.blah' unusable. Aug 09 22:35:29 host.blah ntpd[3574]: restrict: […]
经过几个小时的search和debugging,我放弃了! 关于长时间运行PHP过程有成千上万的问题和文章,但是没有解决我的问题。 我有一个PHP脚本与以下代码: $cur = 0; // Second, loop for $timeout seconds checking if process is running while( $cur < 31 ) { sleep(1); $cur += 1; echo "\n —- $cur —— \n"; } 它只是打算跑31秒。 我有一个Nginx,PHP在debian服务器上configuration为fastcgi。 我设置了max_execution_time = 600 在 /etc/php5/fpm/php.ini 我甚至把它放进去 /etc/php5/cli/php.ini 也设置 request_terminate_timeout = 600 在/etc/php5/fpm/pool.d/www.conf 我也在nginx.conf http部分做了这些修改 client_header_timeout 600; client_body_timeout 600; send_timeout […]
我在nginx日志文件中遇到问题。 以前我只做日志文件, access_log /var/log/nginx/infotrack_access.log rsyslog; 我将下面的文件添加到我的/etc/nginx/sites-available/alpha.conf文件中, access_log syslog:server=localhost:514,tag=infotrack rsyslog; 在我添加这行后,我遇到的问题是文件infotrack_access.log而不是文件infotrack_access.log.1 。 这里是/etc/logrotate.d/nginx文件, /var/log/nginx/*.log { daily missingok rotate 14 compress delaycompress notifempty create 0640 www-data adm sharedscripts prerotate if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ run-parts /etc/logrotate.d/httpd-prerotate; \ fi \ endscript postrotate invoke-rc.d nginx rotate >/dev/null 2>&1 endscript } 当我重新加载或重新启动nginx时,一会儿日志logging到innfotrack_access.log ,但过了一会儿,日志再次进入infotrack_access.log.1 为什么发生这种情况? 我在/etc/nginx/nginx.conf文件中没有做任何修改。 我如何解决它?
我已经安装了一个监听80的nginx服务器和一个8080上的hypnotoad服务器。 现有 example.com = nginx服务器 example.com:8080 = hypnotoad服务器 我想configurationnginx作为反向代理,例如: 需要 example.com = nginx服务器 example.com/up = hypnotoad服务器 nginx服务器位于/ var / www / nginx / public , hypnotoad服务器位于/ var / www / hypnotoad / 我曾尝试将以下内容放置在站点可用文件夹中的nginxconfiguration的末尾: location / { proxy_pass http://127.0.0.1:8080/; } 当我访问example.com/up时,我仅被提供文本和超链接。 没有一个CSS或JavaScript的工作 。 当我从浏览器中查看源代码时,它指向nginx服务器的资产,而不是hypnotoad服务器。 我如何解决它?
我有一个Amazon EC2实例。 我想在其上安装nginx web服务器。 我在Powershell(Windows 10)中build立了一个连接到服务器。 PowerShell截图我已经search,但还没有find答案。 我知道这可以在Linux中轻松完成,但我想在Windows中完成。 有没有办法做到这一点? 尝试安装Chocolaty,但看起来像巧克力作为PowerShell存储库源在EC2实例机器上不可用。 该实例是Windows Server 2016数据中心版本Nano。 我可以感觉到一些非常小的东西丢失了,但是却不知道是什么。