如果我使用rm /my/folder/*.* ,那么运行在nginx和php上的networking服务会使用X-Accel-Redirect头文件将文件传递到客户端。 rm /my/folder/*.*如何处理当前正被客户端访问/下载的文件?
我正在与NGINX合作,我只是build立了一个域和子域,我需要两个SSL。 查看子域的服务器块 server { listen 80; listen 443 ssl; server_name www.desktop.just4bettors.mobi desktop.just4bettors.mobi; root /home/c0pt/capilleira/capilleiraclickandgambleweb/dist; ssl_certificate /etc/ssl/certs/just4bettors.mobi.chained.crt; ssl_certificate_key /etc/ssl/private/just4bettors.mobi.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { index index.html index.htm; … } } 如果我进入该子域,一切工作都会进行,但是,我应该如何知道SSL是否已经build立?
我已经安装了phpmyadmin,并将其链接到我的LEMP服务器上(php 7)。但是当我转到hostname / phpmyadmin时,它在标题栏上返回一个带有phpmyadmin图标的空白页面。 和浏览器的控制台中的3个错误: 无法加载资源:net :: ERR_INCOMPLETE_CHUNKED_ENCODING Uncaught ReferenceError:$未定义 Uncaught ReferenceError:没有定义PMA_commonParams 我已经尝试了很多解决scheme,但无法find最新的问题:( 服务器configuration: server { # listen 80 ; # listen [::]:80 default_server; # SSL configuration # listen 443 ssl default_server; listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers […]
我有一个域名,包括破折号,例如the-domain.com ,当我做了一个服务器块的服务器名称我的域名,并重新启动nginx,我得到一个警告: 重新启动nginx:nginx:[warn]服务器名称“/var/www/domain.com/www/thedomain”在/etc/nginx/sites-enabled/domain.com:56 nginx中有奇怪的符号。 所以我把域名换成了另外一个域名,它仍然继续从上面说出同样的错误。 我不明白为什么当我把它改为合适的时候这样说呢? 这个重复的错误: 重新启动nginx:nginx:[warn]服务器名称“/var/www/domain.com/www/domaindir”在/etc/nginx/sites-enabled/domain.com:56 nginx中有奇怪的符号。 我的域的configuration文件如下所示: server { server_name domain.com; root /var/www/domain.com/www; index index.php index.htm index.html; error_page 404 /404.html; error_page 500 502 503 504 /50x.html; access_log /var/www/domain.com/logs/access.log; error_log /var/www/domain.com/logs/errors.log; error_page 404 /index.php; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/domain.com/www$fastcgi_script_name; include fastcgi_params; } } server { server_name ~^(.+)\.domain\.com$; […]
如何在www上redirect请求 到非www版本? 这应该包括对根域以及任何(通配符)子域的请求。 我也不想要任何不必要的if语句,按照nginx的陷阱文档。 这是我迄今为止,但它似乎只适用于根域,而不是subdoamins。 server { listen 80 default_server; server_name www.*; rewrite "^www\.(.*)" $scheme://$1 permanent; }
我该怎么做呢? 这似乎在默认情况下工作在Apache,但不是在Nginx上出现?
我用nginx和php-fpm运行了一个安装程序。 我发现,当php-fpm不可用时,nginx响应404错误。 我认为这不是正确的答案,我会期望,如果无法使用php-fpm,我的networking服务器将以5xx错误响应。 我的configuration现在工作正常,但我更喜欢在遇到php-fpm崩溃的情况下,我的服务器响应错误代码5xx(即500或503)。 有没有办法来configuration这个? 这是我的实际configuration: location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm.piwik.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_cache_bypass $skip_cache; fastcgi_no_cache $skip_cache; fastcgi_cache piwik; fastcgi_cache_valid 60m; fastcgi_param GEOIP_REGION $geoip_region; fastcgi_param GEOIP_REGION_NAME $geoip_region_name; fastcgi_param GEOIP_CITY $geoip_city; fastcgi_param GEOIP_AREA_CODE $geoip_area_code; fastcgi_param GEOIP_LATITUDE $geoip_latitude; fastcgi_param GEOIP_LONGITUDE $geoip_longitude; fastcgi_param GEOIP_POSTAL_CODE $geoip_postal_code; fastcgi_param GEOIP_ORGANIZATION $geoip_org; fastcgi_param QUERY_STRING $query_string; fastcgi_param […]
我试图设置一个nginx的configuration,其行为类似于我们的生产服务器,其中端口80的请求被redirect到443,它工作正常,当你正在开发的开发机器,但如果你在另一台机器上,尝试从IP访问开箱,它将从IPredirect到本地主机。 例如http://192.168.1.10 -> 301 -> https://localhost 由于我们有很多远程开发人员,因此我不知道开箱时的IP地址是什么。 我试着不定义server_name属性以及将其分配给_ ,在这种情况下都不起作用。 将虚假域分配给服务器名称并让开发人员pipe理其主机文件是否有我能做的事情? /etc/nginx/sites-available/default : # … server { listen 80; server_name localhost; return 301 https://$server_name$request_uri; } server { listen 443 ssl; server_name localhost; add_header Strict-Transport-Security max-age=15768000; ssl_certificate /etc/nginx/server.crt; ssl_certificate_key /etc/nginx/server.key; location / { proxy_pass http://app_server; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; include "/etc/nginx/proxy_params" } location […]
我有Nginx的PC“A”与ASP.NET与电脑“B”的IIS。 nginx是这样configuration的: … location〜((Web | Script)Resource。*)$ { proxy_pass "B"/$1; proxy_redirect off; proxy_set_header REMOTE_ADDR $remote_addr; proxy_set_header REQUEST_URI $request_uri; proxy_set_header HTTP_REFERER $http_referer; #proxy_set_header REQUEST_URI $request_uri; proxy_set_header QUERY_STRING $query_string; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }… 但要求 “B”/ WebScript?A = B& C = d 不能将GET数据(a = b&c = d)传递给IIS部分。 任何人都可以帮忙吗? 编辑: 还有一些额外的信息: nginx也被configuration为将其他数据代理到Apache,在“A”上运行一切都很好(至lessGET是好的)。 configuration与上面相同,但是对于不同的位置
可能重复: Apache与Nginx 你喜欢哪个? 请只回答那些使用(d)两者。 对于更大的网站有什么更好的更好的configuration? 我从来没有使用nginx,因为我没有电脑/服务器来testing它