我突然有一个客户在编程方面不太了解。 所以在这种情况下最好的解决scheme是 – 在我的服务器上运行应用程序,同时保持他的域名在他的控制之下 。 他在那里安装了Nginx,所以没有configuration它的问题。 问题是, 当具有代码的服务器不同于他的域指向的服务器时 , Nginx是否支持这种情况 ? 还有什么其他解决scheme? 我知道haproxy和bind9 。 我不希望最终用户注意到任何301redirect或类似的。
我正在尝试设置nginx,我得到一个403错误。 以下是我如何在Centos7下configurationnginx。 FIrewall没有运行。 vi /etc/nginx/conf.d/default.conf server { listen 80; server_name _; location / { root /data/www; index index.html; } } 权限如下: namei -l /data/www/index.html f: /data/www/index.html drwxr-xr-x root root / drwxr-xr-x nginx nginx data drwxr-xr-x nginx nginx www -rwxr-xr-x nginx nginx index.html /etc/nginx/nginx.conf文件说用户nginx正在运行,应该是nginx。 我检查过,确实是在nginx用户下运行的。 为什么我仍然收到403消息?
我有nginx 1.6.2服务一个wordpress网站,用php-fpm。 固定链接设置如下: /blog/%postname%/ nginx正确地为网站页面( / , /products , /contact …)以及博客文章(在/blog/ )提供服务。 404s可以很好地用于博客文章(即example.com/blog/idontExist将以404响应)。 但是,浏览到example.com/iDontExist会得到HTTP 200响应和网站索引页的内容,而不是404。 这是我的nginx.conf: server { server_name example.com; root /var/local/example.com/; access_log /var/log/nginx/example.com-access.log main; error_log /var/log/nginx/example.com-error.log; error_page 404 /index.php?$request_uri; location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; # fastcgi_split_path_info ^(/blog)(/.*)$; include /etc/nginx/fastcgi_params; #fastcgi_intercept_errors on; #fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index […]
我有nginx主机由jekyll生成的静态网站的实例。 我在端口4000上添加了一个nodejs应用程序,并根据DigitalOcean上的本教程进行操作 server { listen 80; root /usr/share/nginx/html/example.com; index index.html index.htm; server_name example.com; charset utf-8; location /nodeapp/ { proxy_pass http://localhost:4000/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } 应用程序加载,但所有的静态资源得到404,因为它例如查找example.com/nodeapp/css/main.css资源。 我将如何解决这个问题?
我的curl请求如下所示: curl –header "Authorization: Basic BASE_64" https://example.com –tlsv1 -k (我需要明确提供TLS并跳过validation) 它的工作。 我想设置nginx作为中间件和处理远程服务器的身份validation。 location / { proxy_pass {{ remote_server }}; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Authorization "Basic {{ base64_token }}"; } 不幸的是,在这些设置下,我得到了403个禁止。 我在做什么不同于curl请求? 我的error.log显示: 2014/12/20 02:40:12 [error] 15676#0: *13 connect() failed (111: Connection refused) while connecting to upstream, client: MY_OWN_IP, server: _, request: "GET […]
谷歌很多,并没有find解决scheme。 在这里find了几个接受的答案在stackoverflow,但他们没有帮助我。 我正在使用stream浪者发展,或者至less试图使用它。 有没有安装它的问题,但是当我尝试运行一个网站,我越来越404,我的猜测是,这是更多的Nginx问题,而不是stream浪问题。 我已经添加到我的Windows主机127.0.0.1 lara.dev 这是我的nginx网站configuration如下: server { listen 80; server_name lara.dev; root C:/xampp/htdocs/lara/public; index index.html index.htm index.php; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } access_log off; error_log /var/log/nginx/lara.dev-error.log error; error_page 404 /index.php; […]
我试图在Ubuntu上部署一个新的(第一次)Nginx服务器。 我正在关注DigitalOcean的教程,在这里find 。 正如本教程所示,我将每个站点放置在/var/www/domain.tld的主机上。 当我尝试使用git时,出现了我遇到的问题:一些站点存储在git repos中,但是尝试使用sudo与git导致权限错误(在git结尾)。 我正在寻找的是一种安全的方式,允许我的用户帐户访问站点目录,而无需通过sudo。 我不想在我的用户的主文件夹中使用一个目录(如~/var/www因为这使得站点依赖于我的用户)。 哪里是一个合理的标准化的地方来存储用户可访问的网站?
在以下情况下,Nginx应该将任何CGI请求redirect到“/ usr / share / nagios / sbin”: location ~ \.cgi$ { AND location /nagios { 每种情况都可以正常工作。 请求“newco.com/nagios”去正确的地方,并请求“whatever.com/*.cgi”去同一个地方。 但是我怎样才能把它们结合起来,这样只有“newco.com/nagios/*.cgi”在“/ usr / share / nagios / sbin”目录下才会出现?
Fitrst我从Nagios收到NGINX的通知。 当我检查服务器 – 有很多完整的交换和内存。 我在日志中发现奇怪的条目: 65.49.14.146 – – [04/Jan/2015:16:06:11 +0200] "GET /EC65E041-8DDF-D04A-8307-38506B99BE22/6C6CCDBA-AFF1-E54F-A6A6-0D7A76E35801/from HTTP/1.1" 404 11564 "http://domain.ua/lalala" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" "-" 什么是: EC65E041-8DDF-D04A-8307-38506B99BE22 / 6C6CCDBA-AFF1-E54F,A6A6-0D7A76E35801 我在防火墙上禁止了这个IP,洛杉矶和内存现在看起来不错。
我已经为我的网站购买了多个域名。 现在,我redirect这些停放的域(指向我的nginx ipaddress的域)如下所示: server { server_name example.com www.example; rewrite ^(.*) http://example.co.uk$1 permanent; } 现在,我有超过5或6个停放的域名都指向这个ipaddress(1个站点)。 所以,如果我有多个停放的域名为同一个网站,我唯一的select是写一个真正冗长的server_name这样? server { server_name example.com www.example example.org www.example.org example.net www.example.net examples.com www.examples.com examples.org www.examples.org examples.net www.examples.net; rewrite ^(.*) http://example.co.uk$1 permanent; } 以上不适合我。 但是我的问题是,这是如何完成的? 我的意思是,如果我有很多停放的域,我只是一个添加不断添加到我的Nginxconfiguration的服务器块的冗长的行,这应该没有问题? 有人可以请澄清这一点,请…