我试图设置我的网站与fastcgi_cache运行,发现它有点问题,它不真正刷新内容时,一些新的东西添加到我的网站/网上商店。 所以我偶然发现了插件nginx_helper,这似乎是我需要的一切 – 但它需要安装fastcgi_purge_cache模块。 我现在已经尝试了几次刷新AWS服务器(显然nginx和东西安装),但我似乎无法得到它的工作。 build立: * AWS服务器 * Nginx / php-fpm / php 7 * WordPress的 * CentOS 7 我对服务器的东西很陌生,我尝试了几个不同的指南 – 但最终似乎没有任何的锻炼。 我试图安装https://github.com/FRiCKLE/ ,但我不太清楚如何正确地做到这一点
我的nginx有一个问题:它只监听nginx上的默认虚拟主机,而不监听其他使用ipv6的vhost。 这是默认的虚拟主机networkingconfiguration: server { listen 80 default_server; listen [::]:80 default_server ipv6only=off deferred; } 这是第二个虚拟主机networkingconfiguration: server { listen 80; listen [::]:80; } nginx告诉我的错误是这样的: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) 你可以帮我吗? 谢谢大家。
我正在从Apache转换到Nginx。 自从Nginxreplace为%2B后,我遇到了问题。 我的nginx.conf: location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/sockets/php.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_read_timeout 7200; } 当我使用Apache时, $_SERVER["QUERY_STRING"] : 'nome_portfolio=+cart2+cart45&id=0&operacao=listar&id_filtrado=0&portfolio_editavel=' 使用Nginx: 'nome_portfolio=%2Bcart2%2Bcart45&id=0&operacao=listar&id_filtrado=0&portfolio_editavel='
我正在尝试在Nginx的map指令中join一个variables和一个string,但目前还没有运气。 这个想法是,任何请求/press/some-variable-text应该被redirect到/magazine/some-variable-text map $uri $new_uri { ~^/press/(?<press_id>.+)$ /magazine/$press_id; } 这个输出是下面的string“ / magazine / $ press_id ”(它不插入variables)。 当我删除前缀/magazine/然后variables内容呈现正常。 有没有办法做到这一点?
server { listen 80; server_name _; location /test/ { proxy_pass http://example.com/page.php; } } 目前,当我使用这个Nginx反向代理时,当我从test.com/test/访问时,它服务于我https://example.com/page.php但url保持不变。 当我调用$_SERVER['http_host'] ,它会返回example.com的主机名,而不是我发出请求的主机名(域中的url)。 我试过使用: proxy_set_header Host $host; 但是,这导致我运行后,404页面。 简而言之, 我想访问test.com/test并获得http://example.com/page.php, but have the when I call在PHP when I call $ _SERVER` when I call of test.com/test but have the主机名 编辑: events { worker_connections 1024; } http { sendfile on; tcp_nopush on; tcp_nodelay […]
漫长的网站,有时最终给502 Bad Gateway 很多地方,交换使用40/1024 但是failed (104: Connection reset by peer) while reading response header from upstream nginx日志显示错误failed (104: Connection reset by peer) while reading response header from upstream 试图重新启动nginx,杀死进程。 告诉我如何用nginx解决这个问题?
这是我第三次尝试发布这个问题后,不正确张贴到超级用户和堆栈溢出。 希望这是现在正确的地方! 我接pipe了公司的networking托pipe服务,这是一个运行亚马逊自己版本的Linux和Nginx的AWS服务器。 我对Nginx没有多less经验,但是我需要创build一个运行网站开发版本的子域。 已经有一个现有的“分段”虚拟主机,但它连接到主站点数据库没有用处。 我已经从/etc/nginx/conf.d/staging.conf中将staging conf文件复制到/etc/nginx/conf.d/dev.conf,并将文件中的所有“staging”实例更改为“dev”。 这是这个文件的样子: upstream php-dev-backend { server unix:/tmp/php-fpm-dev.sock weight=1; } server { server_name dev.groundlevel.co.uk; listen 80; root /var/www/vhosts/dev.groundlevel.co.uk/web-root; index index.html index.htm index.php; access_log /var/log/nginx/dev.groundlevel.co.uk_access_log; error_log /var/log/nginx/dev.groundlevel.co.uk_error_log; location @handler { rewrite / /index.php; } location / { index index.php index.html; try_files $uri $uri/ @handler; expires 30d; } include magento_security; include fastcgi_params; […]
我有以下目录结构: mysite.com – /api (codeigniter RESTful API Server) – /app (backbonejs app) 我试图configurationNGINX指向mysite.com/api*的所有请求到api目录并使用Codeigniter的设置。 我发现的一切工作正常,如果configuration文件在根目录。 但是,当你尝试把它放在一个子目录中时,就会失败。 这是我现在有: server { listen 80; server_name local.mysite.com; root /Users/me/Sites/mysite; autoindex on; index index.html index.php; location /api { try_files $uri $uri/ /api/index.php; location ~ \.php$ { root /Users/me/Sites/mysite/api; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } } 这样做只是给我一个“文件未find”的错误。 甚至没有一个适当的nginx 404.如何在服务器的subdir中为CodeIgniterconfigurationNGINX? […]
我试图设置由Jwilder组合的Letsencrypt伴侣容器为ssl制作的Nginx代理泊坞窗容器。 behing代理目前是一个单一的网站,使用球童作为其服务器。 操作系统是Ubuntu 16.04,在防火墙中,我打开了端口80和443.没有Nginx代理,我可以通过HTTPS连接到网站。 但是对于nginx-proxy,我无法通过HTTPS连接到网站。 当我连接到是得到错误,ERR_CONNECTION_REFUSED。 我不知道什么可能会导致错误。 docker-compose yml文件: version: '2' volumes: postgres_data: {} postgres_backup: {} caddy: {} services: nginx-proxy: image: jwilder/nginx-proxy ports: – "80:80" – "443:443" volumes: – /var/run/docker.sock:/tmp/docker.sock:ro – /path/to/certs:/etc/nginx/certs:rw – /etc/nginx/vhost.d – /usr/share/nginx/html labels: – com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy nginx-proxy-ssl-companion: image: jrcs/letsencrypt-nginx-proxy-companion volumes: – /var/run/docker.sock:/var/run/docker.sock:ro volumes_from: – nginx-proxy django: build: context: . dockerfile: ./compose/django/Dockerfile depends_on: […]
我有一个Nginx代理的特定需求 我在主urlnew.example.com下有一个全新的JS应用程序(+ nginx),以及一个运行在不同url上的旧应用程序old.example.com 我需要为我的新应用程序处理search引擎的预渲染(我使用prerender nginx官方脚本作为基础)。 旧的应用程序并不需要预渲染(现在它已经成为我的预渲染器) 当用户inputwww.example.com时,他碰到我需要的nginx代理 代理/admin到old.example.com/admin 将所有机器人请求代理给预渲染器 默认代理到new.example.com 为了使事情更简单,我有代表每个应用程序@地点块(但也许这是不相容的,请告诉我) location @newapp { proxy_pass http://new.example.com:8080; } location @oldapp { proxy_pass http://old.example.com:8080; } 现在,当我的新应用程序正在开发中时,我希望/adminurlredirect到我的旧应用程序。 我在网上find了一个使用try_files和maintenance.html文件的技巧 location /admin { try_files /maintenance.html @oldapp; } 现在事情也变得严重 – 我的新应用程序需要预渲染 – 我的旧应用程序不需要预渲染,并用作当需要元素的后备 – 现在我没有prerenderer应用程序(我将安装/设置prerenderer。后来)所以我使用我的旧应用程序作为bot引擎的预渲染器 location @prerenderer { try_files /maintenance.html @oldapp # will later be changes to prerenderer.io } # in […]