我正在寻找一个特定的页面,example.php,如果通过SSL访问,则redirect到非SSL版本。 我应该看什么types的重写?
我正在运行我的个人网站与python在nginx与uwsgi写。 由于该网站是非常静态的,我想通过添加微型caching来提高性能。 nginx和uwsgi都提供caching。 nginx微caching的例子 uswgicaching的例子 有人可以解释两个变种之间的差异,给我一个最好的build议?
我在我的nginx conf中有以下指令,正在正常工作: location = /favicon.ico { root /home/www/myapp/static/ico; } location ^~ /apple-touch-icon { root /home/www/myapp/static/ico; } 我会合并这些expression式在一个指令,但我不知道如何正确构build正则expression式。 我尝试了以下,但它只适用于favicon.ico,我得到404请求/apple-touch-icon-precomposed.png location ~* ^/(apple-touch-icon(.)*\.png|favicon.ico) { root /home/www/myapp/static/ico; } 这是一个什么是我认为匹配的问题。
我正在做出决定,但我不确定是否可以用NGINX做以下事情: NGINX将被安装在一个将有一个Windows VM的Linux服务器上 NGINX可以将一组固定的域名指向本地的Apache,并将所有其他的一切代码都转发给Windows VM。 据我所知,只有在Apache和Windows VM上托pipe的固定域集可以包含任何数量的未知域。 这甚至可以工作吗? 我可以使用某种types的数据库(mysql,postgre,mongo,redis,couchbase,memcached?)从哪里nginx可以得到的域名列表和路由他们? 有一个更好的方法吗 ?
我正在尝试configurationOpenResty(nginx)将任何非www域redirect到www。 一 但是我正在享受的是:www.www.domain.com 是吗? 这里是我的服务器块 server { listen 80; server_name ^$http_host$; return 301 http://www.$http_host$request_uri; } server { listen 80; server_name ~^(www.)$$http_host; location = / { content_by_lua ' ngx.say("Host: ", ngx.req.get_headers()["Host"]) '; } } 任何帮助是极大的赞赏。
这是我的基本configuration: server { server_name mysite.dev; root location/of/my/html; location / { index index.html; try_files $uri $uri/ =404; } } 然而,当我浏览到mysite.dev我收到一个PHP文件的文本: <?php if(!defined('APPLICATION_ENV')) { define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')); } define('ROOT_PATH', realpath(dirname(__FILE__))); define('LIBRARY_PATH', ROOT_PATH . '/library'); …..etc 这是事情,我什至不想服务于PHP。 我只想按原样提供这些文件,不需要进行服务器端处理。
我目前有一个nginx服务器发送Content-Security-Policy头,但是我已经读了,显然IE只支持“X-Content-Security-Policy”。 将Content-Security-Policy和X-Content-Security-Policy头与请求一起发送,还是会产生冲突? 而不是一个好主意,使用条件语句发送正确的浏览器正确的头 – 基于用户代理?
我在EC2上运行nginx,目的是设置phabricator。 这是我的nginx.conf文件: # For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ user eng; worker_processes 1; error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info; 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 […]
我正在运行ngnix和php5-fpm,我在Ubuntu 13.04上 server { server_name website.com; access_log /srv/www/website.com/logs/access.log; error_log /srv/www/website.com/logs/error.log; root /srv/www/website.com/public_html; location / { index index.html index.htm index.php; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /srv/www/website.com/public_html$fastcgi_script_name; } } 我在/srv/wwww/website.com/public_html/phpmyadmin中有一个到/ usr / share / phpmyadmin的符号链接 不知道发生了什么,我对这一切都很陌生。
我认为使用HTTPS时公共caching是不可能的,因为每个响应都是不同的(由于encryption),但是现在我意识到至less可以caching未encryption的响应,服务器只需要对每个响应进行encryption新用户。 这是怎么做的默认? 如果不是,可以这样做吗? 我正在用fastcgi_cache来使用nginx。