你能帮我实现以下 我希望http://bla.domain.com指向下面的链接。 http://bla.example.com:4321/?nick=Nick…..&&channels=Bulgaria%2CSofia%2Csex%2C30-40&prompt=1&uio=OD1mYWxzZSY5PXRydWUmMTI9dHJ1ZQf0&prompt=1 我跟着原来的nginx的东西 – > https://www.nginx.com/resources/wiki/start/topics/recipes/qwebirc/ 在目前index.html没有呈现,因为我想要它或更好的洞链接指向http://bla.domain.com 你可以查看下面我所做的conf至今。 server { server_name bla.example.com; location / { autoindex on; autoindex_exact_size off; root /home/user/qwebirc/; index index.html; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_buffering off; proxy_pass http://127.0.0.1:4321; } #location / { # autoindex on; # autoindex_exact_size off; # root /home/user/qwebirc/; # index index.html; # try_files […]
我想在Elastic Beanstalk中用Nginx设置2个虚拟主机。 由于我无法将多个SSL证书绑定到ELB,因此我正在使用CloudFront将我想要关联的3个SSL证书提供给不同的子域。 所以我的情况就是这样 Cloudfront ===> ELB ===> EB ==> EC2实例。 我创build了2条指向不同CloudFront分发列表的CNAMElogging,并且当我点击domain1.example.com / domain2.example.com时,我可以看到使用自签名证书在EB上部署的应用的login页面。 我现在想要做的是,为domain1 / domain2和/etc/nginx/nginx.conf创build2个不同的login页面我有这个configuration #Elastic Beanstalk Nginxconfiguration文件 用户nginx; error_log /var/log/nginx/error.log警告; pid /var/run/nginx.pid; worker_processes auto; worker_rlimit_nofile 133985; 事件{ worker_connections 5760; } http { 包括/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“' '“$ […]
我有一个服务器,可以接收/one_a或/one_bpath中的请求。 我redirect/one_a?b?/some to /other 。 我也需要redirectcookiepath。 我尝试: location ~ /one_a?b?/some { rewrite ^/one_a?b?/some/(.*)$ /other/$1 break; proxy_pass http://127.0.0.1:3030; 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; proxy_cookie_path /other $request_uri; } 但是当请求是/one_a/some/login ,redirect的cookiepath变成/one_a/some/login 。 我需要结果是/one_a/some 。 注意: 我知道正则expression式也接受/one_和/one_ab这对我来说可以。
我的Nginx是在一个经典的ELB背后,它已经工作。 由于限制原因,我想获得ELB IP地址。 所以,如果有来自ELB的即将到来的请求,我会允许的,如果来自其他ELB的电子邮件将会有另一个逻辑来阻止/限制它。 但现在,我只想让nginx知道转发请求的LB。 我怎样才能在NGINX中获得ELB的IP地址?
在我的应用程序中,我有一个路由/audio/ *,所以任何数量的audio文件夹被路由拾取。 我不确定如何在Nginx中处理它。 基本上我需要访问这些文件:a)存储在网站根目录之外的文件; b)4或5个目录。 我只能把3作为别名,因为其他人事先不知道。 这是一个url 10.0.2.2 – – [03/Nov/2017:23:21:33 +0000] "GET /vagrant/TestRails/Music/VA%20-%20Punk%2045%20Chaos%20in%20the%20City%20of%20Angels%20and%20Devils%20(2016)/20%20The%20Hollywood%20Squares%20-%20Hollywood%20Square.mp3 HTTP/1.1" 500 595 "http://127.0.0.1:8080/audio/vagrant/TestRails/Music/VA%20-%20Punk% 2045%20Chaos%20in%20the%20City%20of%20Angels%20and%20Devils%20(2016)/20%20The%20Hollywood%20Squares%20-%20Hollywood%20Square.mp3" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" 我的网站是/vagrant/TestRails/MediaExplorer ,audio文件存在于/vagrant/TestRails/Music/…/ 。 编辑:发布整个服务器块: server { listen 80; server_name localhost:8000; access_log /var/log/nginx/access.log; error_log /var/log/nginx/errorlog debug; root /vagrant/TestRails/MediaExplorer; index /home.slim; location / { proxy_set_header X-Real-IP […]
我需要nginx pid与monit一起工作,pid只是意外消失,我必须重新启动vps才能恢复! 每天晚上都在发生! 但即使他消失了,他仍然在跑! 在线网站! 但显然我无法监测状态,重新启动,停止等…我需要PID! 当我试图通过terminal看到我的状态 terminal命令行输出错误: service nginx status ● nginx.service – A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: en Active: failed (Result: exit-code) since Sun 2017-11-05 06:25:07 WET; 1h 50mi Process: 5062 ExecStop=/sbin/start-stop-daemon –quiet –stop –retry QUIT/5 – Process: 1527 ExecStart=/usr/sbin/nginx -g daemon […]
我试图从一个新的nginx服务video文件加上安装在centos 7上。我添加了conf server { listen 80; root /usr/share/nginx/html; location /video {} } conf文件默认在用户nginx上运行。 当我尝试访问http://192.168.1.172/video/t.mp4时 ,我得到一个禁止403,错误日志作为权限被拒绝。 我已经将用户/ chmod设置为用户nginx。 在同一个文件夹t.html中的其他静态文件服务正常。 [root@localhost video]# ls -al total 1820480 drwxrwxrwx. 2 root root 31 Nov 6 2017 . drwxr-xr-x. 4 root root 4096 Nov 6 2017 .. -rw-r–r–. 1 root root 9 Nov 6 2017 t.html -rwxrwxrwx. 1 nginx nginx […]
我有一些内部的API服务器api.example.com ,在这种情况下(在这种情况下,我无法控制这个服务器)在某种请求的情况下返回一个包含yes或no网页,其状态码是200 。 我正在尝试在frontend.example.com上设置一个nginxconfiguration,该configuration将frontend.example.com/foobar代理到api.example.com ,并且我希望回答查询时可以select200或yes ,或者4xx no – 说400在这里保持简单。 我不特别关心响应体,因为这只会被脚本使用。 我希望安装程序是独立的,为此,我宁愿没有外部脚本/网站/代理工作; 即。 我想完全在nginxconfiguration中完成(最好没有非库存模块)。 总之,我会不知何故需要对返回的网页内容的某种谓词,这将使我能够写类似的东西 if ($webpage_content = "yes") { return 400; } 我还没有find任何文件。 有没有办法做这样的事情? 谢谢!
我将nginxconfiguration为反向代理。 我有我的nginx.conf中的以下内容: user www-data; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; events { worker_connections 768; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; server_names_hash_bucket_size 64; include /etc/nginx/mime.types; default_type application/octet-stream; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip off; gzip_disable "msie6"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } mail { server […]
我正在尝试为某人设置一个Nginx Web服务器,而且目前的configuration似乎没有问题。 / var / www / html / ender肯定有一个WHMCS安装位于其中,但每次我尝试访问它,网页给我一个404错误。 我有符号链接的目录,但似乎仍然有一个潜在的错误。 附加的是hastebin,下面是当前的NGINXconfiguration块,减去域名。 (Ubuntu 16.04与NGINX) server { listen 80; server_name DELETED_DOMAIN; return 301 https://$server_name$request_uri; } server { listen 443 ssl http2; server_name DELETED_DOMAIN; root /var/www/html/ender; index index.php index.html index.htm; # allow larger file uploads and longer script runtimes client_max_body_size 100m; client_body_timeout 120s; sendfile off; # strengthen […]