我在/etc/nginx/ssl folder有这三个文件: www.mydomain.com.csr www.mydomain.com.key www.midomain.com.key.nopass 我在/etc/nginx/ssl/www_mydomain_com folder购买并下载了正确的ssl证书这三个文件: AddTrustExternalCARoot.crt PositiveSSLCA2.crt www_mydomain_com.crt 当我尝试用这个命令安装签名证书时: sudo cat www_mydomain_com.crt PositiveSSLCA2.crt AddTrustExternalCaRoot.crt > www.mydomain.com.pem 我得到这个错误: -bash: www.mydomain.com.pem: Permission denied 我怎样才能解决这个错误,并安装我的SSL?
我有一个我最近升级到nginx 1.4系列的个人网站。 我启用了SPDY支持,使用Chrome扩展SPDY指标,我可以看到头版不使用SPDY。 一旦我点击其中一个链接,我可以看到SPDY被使用。 这是devise还是我可以影响这种行为? 这是nginx.conf的相应部分: # foo.com (ssl) server { listen 443 ssl spdy; listen [::]:443 ssl spdy; server_name foo.com; ssl_certificate /etc/nginx/ssl/foo.com.pem; ssl_certificate_key /etc/nginx/ssl/foo.com.key; # Remember this setting for 365 days add_header Strict-Transport-Security max-age=31536000; root /srv/www/foo.com; charset utf-8; }
我在运行CentOS 6.3的VPS上安装了nginx,我似乎无法获得任何PHP文件的工作。 这是我的nginx.conf文件: user nginx; worker_processes 2; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/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 /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; […]
这是我无法安装的模块: http://www.grid.net.ru/nginx/eval.en.html 这是我得到的错误: /root/src/nginx_eval_module-1.0.1/ngx_http_eval_module.c: In function 'ngx_http_eval_block': /root/src/nginx_eval_module-1.0.1/ngx_http_eval_module.c:531:39: error: variable 'pclcf' set but not used [-Werror=unused-but-set-variable] /root/src/nginx_eval_module-1.0.1/ngx_http_eval_module.c:522:32: error: variable 'ecf' set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors make[1]: *** [objs/addon/nginx_eval_module-1.0.1/ngx_http_eval_module.o] Error 1 make[1]: Leaving directory `/root/src/nginx-1.2.7' make: *** [build] Error 2 。/configuration ./configure –user=nginx –group=nginx –prefix=/usr/local/nginx-1.2.7 –with-http_ssl_module –with-http_addition_module –without-mail_pop3_module –without-mail_imap_module […]
现在我在MyDomain.com上设置了一个代理服务器:8080,但是我想保证它的安全。 为了得到这个代理设置,我把这个添加到我的nginxconfiguration文件中: server { listen 8080; location / { resolver 8.8.8.8; proxy_pass http://$http_host$uri$is_args$args; } 我尝试search,但只有想出/反向/代理的结果。 我需要一个定期的。
我的系统在https://app.domainname.org和http://www.domainname.org上有一个安全区域。 我看到很多post都提到类似的,但是稍有不同的问题/configuration。 我怎么能使用nginx,确保请求正确的url,但错误的协议自动修复? 例如: 请求http://app.domainname.org/file.html透明地redirect到https://app.domainname.org/file.html 请求https://www.domainname.org/file.html被透明地redirect到http://www.domainname.org/file.html
我目前正在nginx服务器上运行Drupal,并且还在account.domain.com上运行了一个单独的用户帐户系统。 我购买了通配符SSL证书来保护login表单,但SSL尚未设置,但我正在寻找您的意见,使用哪个系统,子目录或子域名。 用户将转到主页,然后按loginbutton。 从那里,他们将被发送到: account.domain.com或domain.com/account 哪个系统将是:1.更安全2.要求服务器的要求更less3.更容易维护和pipe理。 感谢一堆:)
我在Django中间件中设置了一些非caching头来控制xhr请求的caching。 主要是因为IE严重caching了Ajax请求。 class NeverCacheXhrMiddleware(object): """ sets no-cache headers for all xhr requests xhr requests must send the HTTP_X_REQUESTED_WITH header to be identified correctly as a xhr request using .is_ajax() see: http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers """ def process_response(self, request, response): if request.is_ajax(): #add_never_cache_headers(response) #patch_cache_control(response, no_cache=True) response['Cache-Control'] = 'no-cache, no-store, must-revalidate' response['Pragma'] = 'no-cache' response['Expires'] = '0' return response 当我在开发环境中仅使用Gunicorn部署我的应用程序时,这工作正常。 […]
我正在设置一个用于Zend Framework的nginx服务器。 大多数情况下,它的作品。 但是,如果URL末尾有斜线,例如http://localhost/test/ vs http://localhost/test ,则带有斜线的URL将不起作用。 这是意外和不幸的。 我希望它适用于这两个url。 我该怎么做才能解决这个问题? 我的nginxconfiguration是: server { listen 80; server_name mywebsite.com; root /var/www/site/public; location / { rewrite ^/(.*)/$ /$1; include /etc/nginx/fastcgi_params; fastcgi_param APPLICATION_ENV development; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/site/public/index.php; } } 正如你所看到的,我试图添加一个重写条件,但它不是有所作为。
我有一个服务器在176.227.213.2 。 所以我创build了一个默认服务器的configuration文件( default.conf ) server { listen 80; server_name default 176.227.213.2; location / { root /var/www/html; index index.php index.html; } ……… 完整的configuration 。 但是我无法获得一个index.html的工作。 服务器没有响应。 访问日志是空的,我认为这意味着,nginx根本就不听请求。 我检查了path和文件。 我不知道这里有什么问题。 更新 : netstat -plutn Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 590/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* […]