今天,我会问一些比平时技术要差的东西。 的确,这或多或less是一个修辞性的问题,但我很乐意阅读你对这个话题的build议。 在我的日常工作中,我必须处理大量的Web服务器和SSL证书。 在这个工作上,我也必须要处理安全问题,如果你想在安全和浪费时间之间find一个很好的平衡点,这不是很简单。 所以,问题是: 你有没有一个方法能够重新启动你的NGinx / Apache /等Web服务器,而不需要在控制台前的操作员input证书的密码? 我的意思是,我已经有了解决scheme来纯粹地删除密码以使该过程自动化,但是这听起来有点令人毛骨悚然,特别是如果我的服务器被破坏(在运行状态下,所有数据都被encryption)将能够在没有任何密码保护的情况下检索和使用证书。 其他信息:我不能使用发行版提供的原始脚本来启动服务。 我们大多使用NGINXnetworking服务器来处理前端请求和SSL。 我们不想使用Varnish或任何其他SSL优化器。
我刚在Ubuntu 12.04上更新了我的PHP 现在,所有的奇怪,我做了一个简单的phpinfo.php在我的服务器上,然后这502坏网关开始出现。 我检查/etc/nginx/sites-available/default nginxconfiguration文件,看起来一切正常: server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html; index index.php index.html index.htm; # Make site accessible from http://localhost/ server_name localhost; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.html; # […]
Nginx和子域名问题 嗨,这是我的configuration server { listen 80; server_name my_server.com www.my_server.com demo.my_server.com; location / { proxy_pass http://123.456.789.10:8080/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } 我想知道为什么如果我把浏览器指向:my_server.com或www.my_server.com一切正常,但如果我去demo.my_server.com,firefox无法在demo.my_server.comfind服务器。 提示? TIA
我们有一个在Windows服务器上运行的repo服务器,它提供一些静态文件,这些静态文件应该由我们的工作者节点使用Python-urllib抓取。 问题在于,当我们向使用Python存在的文件发出请求时,我们会收到一个404错误,但是,如果我直接从浏览器访问文件,使用Python-urllib正在使用的相同链接,它工作得很好,文件被下载。 示例访问日志: xxx.xxx.xxx.xxx – – [24/Jul/2013:17:15:53 -0400] "POST /x/dl/Bukkit_Beta.jar.conf HTTP/1.1" 405 172 "-" "Python-urllib/2.7" 我在error.log中发现了一些奇怪的东西: 2013/08/04 22:29:11 [error] 6456#2696: *807 CreateFile() "C:\Users\Administrator\Desktop\Nginx/html/MCProHosting/dl/405" failed (2: The system cannot find the file specified), client: 198.15.64.226, server: localhost, request: "GET /MCProHosting/dl/405 HTTP/1.1", host: "repo.mcprohosting.com" 从这些日志看来确实正在生成一个405,而不是404,但是Python显示了一个404页面。 请注意,如果我们通过htdocs / html文件夹传输,这是一个新的下载的nginx下相同的目录结构在Apache下工作。 没有对Nginx进行configuration更改
我买了一个新的VPS,我不是一个Linux的极客。 我已经在CentOS 6上安装了LEMP堆栈。我只是尝试在我的VPS上安装Xcache。 我用下面的命令来安装Xcache,但是显示错误。 我用来安装Xcache的命令 yum install php-xcache xcache-admin 和我得到的错误: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.san.fastserv.com * epel: mirrors.kernel.org * extras: mirror.pac-12.org * updates: mirrors.easynews.com Setting up Install Process Resolving Dependencies –> Running transaction check —> Package php-xcache.x86_64 0:3.0.2-1.el6 will be installed –> Processing Dependency: php(zend-abi) = 20090626 for […]
这是我的子域dev.mypage.com的configuration: server { listen 80; server_name dev.mypage.com; root /home/user/web/dev; index index.html index.htm index.php; access_log /home/user/logs/dev/access.log; error_log /home/user/logs/dev/error.log; location / { try_files $uri $uri/ /index.html; allow xxx.xxx.xxx.xxx; deny all; } location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm/dev.sock; fastcgi_index index.php; include fastcgi_params; } } 我想禁止访问/除我以外的所有文件和子目录 (xxx.xxx.xxx.xxx)。 运行这个configuration和 访问dev.mypage.com与其他IP变成403错误 。 与其他IP访问dev.mypage.com/subdir变成403错误 。 使用其他IP访问dev.mypage.com/index.php 返回页面 。 使用其他IP访问dev.mypage.com/subdir/index.php 返回页面 。 所以情况3和4不按预期工作。 […]
我有一个13.04 Ubuntu服务器与两个关联的IP地址。 比方说,例如,IP是123.456.789.111和123.456.789.222 ,服务器有两个域,比如example1.com和example2.com 。 我目前有Apache的服务example2.com,我有example1.com由Varnish> Nginx服务 。 除了example1.com实际上是由Apache服务的,尽pipe所有的设置显示它应该由nginx服务。 在DNS example1.com指向123.456.789.111和example2.com指向123.456.789.222 。 在 /etc/apache2/ports.conf 我已经设置为: NameVirtualHost 123.456.789.222:80 Listen 80 所以指向这个域的任何域都应该被Apache服务,这就是发生了什么事情。 在 /etc/default/varnish 我已经设置为: DAEMON_OPTS="-a 123.456.789.111:80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s malloc,256m" 因此,指向该域的任何网站都应该被Varnish拾起。 然后在: /etc/varnish/default.vcl 我已经设置为: backend default { .host = "127.0.0.1"; .port = "8080"; } 从varnish到nginx的所有内容, /etc/nginx/sites-available/example1.com root /var/www/example1.com/public/ […]
我们使用expires max来保持静态文件在浏览器中尽可能长时间的caching。 当我们重新部署时,我想强制用户的浏览器转储它的caching文件。 有没有办法与nginx做到这一点?
让我们有一个由Nginx服务的web应用程序,听80端口。 当两个或更多用户尝试访问该应用程序的某个URL时,哪个响应需要很长时间。 例如,十个用户尝试在100秒内为单用户请求加载/give_me_some_charts页面和服务器响应。 每个用户试图通过端口80访问应用程序。 我相信服务器(在我们的例子中是Nginx)将阻止该端口,直到发送响应。 所以处理十个用户需要10 users * 100 seconds == 1000 seconds 。 但是Nginx有一些function叫做平衡 。 现在我不确定服务器如何处理并行请求。 那么,服务器如何处理并行请求以及它如何响应呢? 那Nginx的平衡function是什么?
我使用nginx作为apache2的前端。 Apache2将处理所有dynamic内容。 这是我的主要文件,nginx作为apache的前端,并将所有dynamic页面转发到apache2: server { listen 80; root /var/www/websites/main/htdocs; index index.html index.php index.htm; server_name *removed*; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:81; } location ~ /\.ht { deny all; } } 不幸的是,这会导致redirect循环。 当我使用下面的configuration时,网站加载正常,虽然nginx正在处理所有静态和dynamic内容,这是违背这一点。 server { listen 80; root /var/www/websites/main/htdocs; […]