2018-10-21         Yale

Complex nginx rewrite rules for subdomains

I currently have the following (hacky) re-write rule in my nginx.conf to allow dynamic sub-domains to be re-directed to one Django instance.set $subdomain "";set $subdomain_root "";set $doit "";if ($host ~* "^(.+)\.domain\.com$") { set $subdomain $1; set $subdomain_root "/profile/$subdomain"; set $doit TR;}if (!-f $request_filename) { set $doit "${doit}UE";}if ($doit = TRUE) { rewrite ^(.*)$ $subdomain_root$1; break;}I'm sure there is a more efficient way to do this but I need to change this rule so that any requests to *.domain.com/media/* or *.domain.com...

 nginx                     3 answers                     85 view
 2018-10-21         Hilary

Pass custom parameters with the authorization request using lua-resty-openidc

I'm using lua-resty-openidc to configure NGINX as an OIDC RP with my Authorization Server.My requirement is to pass a value from the initial request coming to the Nginx (from the browser, let's say a query param), in the authorization code request to the Authorization Server (from Nginx).Is there a way to achieve this? Appreciate any help on this. You can pass custom parameters by setting opts.authorization_params as shown in the sample in README.md and here:https://github.com/zmartzone/lua-resty-openidc/blob/master/lib/resty/openidc.lua#L309 [XXX]

 nginx                     1 answers                     15 view
 2018-10-21         King

nginx reverse_proxy with axis camera - default rewrite not working

I've got an AXIS camera sitting behind my firewall. If you cURL to the camera's IP, it wants to redirect you to /view/index.shtml via a meta refresh.I'm trying to access the camera via webserver-IP/camera. My nginx config is simple - it looks like this: location /camera { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_pass http://192.168.0.205:80/; proxy_redirect default; }This however is not working - the redirect isn'...

 nginx                     2 answers                     34 view
 2018-10-21         Tess

Nginx proxy_pass to https

we have:Ubuntu 16.04nginx 1.10.3i am new to nginx and need help on proxy_pass to https.We have clients in internet they call a url for example.https://testapp.mobios.example.comi want to pass this traffic to my server with the ip address 192.168.0.10.On this server i have ssl enabled listen port 9443.We want use nginx as reverse_proxy.My nginx config looks like.server { listen 443; servername testapp.mobios.example.com; location / { proxy_pass https://192.168.0.10:9443;}}If the clients try to contact the ssl server with https://testapp.mobios.example.com they get no...

 nginx                     1 answers                     37 view
 2018-10-21         Alva

Reverse proxy location to docker container

I need to redirect petitions from www.domain.co or domain.co to nginx server (currently working), https must be enforced (currently working). I do need to redirect domain.com/location_a/ and www.domain.com/location_a/ to a docker container (partially working). Here's my site nginx config:upstream blog_container { server localhost:88;}server { root /var/www/domain.co/html/; index index.html index.htm index.nginx-debian.html; server_name domain.co www.domain.co; location / { try_files $uri $uri/ =404; } location ^~ /...

 nginx                     1 answers                     39 view
 2018-10-21         Flora

Nginx missing trailing slash returns 301

I have the following config:server { listen 80; server_name localhost; location /app { root /usr/share/nginx/html; index index.html index.htm; try_files $uri $uri/ /app/index.html?$args; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; }}When navigating to http://localhost:8000/app/ all works as expected but when removing the trailing slash (http://localhost:8000/app) nginx returns 301 status response and I am being redirected to http://localhost/app.How can I make nginx work with both http://local...

 nginx                     1 answers                     40 view
 2018-10-21         Archibald

uWSGI nginx error : connect() failed (111: Connection refused) while connecting to upstream

I'm experiencing 502 gateway errors when accessing my IP on nginx(http://52.xx.xx.xx/), the logs simply says this: 2015/09/18 13:03:37 [error] 32636#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.xx, server: xx.xx.xx.xx, request: "GET / HTTP/1.1", upstream: "uwsgi://127.0.0.1:8000", host: "xx.xx.xx.xx"my nginx.conf file# the upstream component nginx needs to connect toupstream django { # server unix:///path/to/your/mysite/mysite.sock; # for a file socket server 127.0.0.1:8000; # for a web port socket (we'll use this fi...

 nginx                     5 answers                     42 view
 2018-10-21         Bartholomew

Getting internal server error in nginx if I upload Image

I running an app with uWSGI, nginx and falsk . When I run my server manually and upload image then it works fine but when i run my app as live with nginx then i am getting internal server error My conf file isserver { listen 80; root /srv/www/tmapi; set $home_dir "/srv/www/api/"; client_max_body_size 12m; server_name x.x.com; access_log /srv/www/api/logs/nginx_access.log; error_log /srv/www/api/logs/nginx_error.log debug;location /static/ { alias $home_dir/app/static/; access_log off; expires max;}location / { try_fi...

 nginx                     1 answers                     43 view
 2018-10-21         Kitty

Can Nginx be used instead of Gunicorn to manage multiple local OpenERP worker servers?

I'm currently using Nginx as a web server for Openerp. It's used to handle SSL and cache static data.I'm considering extending it's use to also handle fail over and load balancing with a second server, using the upstream module.In the process, it occurred to me that Nginx could also do this on multiple Openerp servers on the same machine, so I can take advantage of multiple cores. But Gunicorn seems to the the preferred tool for this.The question is: can Nginx do a good job handling traffic to multiple local OpenERP servers, bypassing completely the need for Gunicorn? Le...

 nginx                     2 answers                     60 view
 2018-10-21         Sandy

Difference between Gunicorn and Nginx

This is a beginer question, but I am having trouble understanding the abstraction between Gunicorn and Nginx. I am not looking for a detailed answer, just at a high level what is the role that each plays? How do they interact? Per Gunicorn's deploy doc, my understanding is that you use Nginx as a proxy server for Gunicorn.As Gunicorn is ported from Ruby's Unicorn, I'm assuming the limitations and specifications of Unicorn apply to Gunicorn as well: Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth conne...

 nginx                     1 answers                     63 view
 2018-10-21         Alger

laravel valet-linux redirect error

I'm running the very useful valet-linux package for my local dev environment. I recently updated it (using composer global update), and now my local Joomla dev sites are not loading properly.The error in ~/.valet/Log/nginx-error.log shows multiple occurrences of 2018/08/11 11:00:28 [error] 7825#7825: *11 rewrite or internal redirection cycle while processing "/home/admin/.config/composer/vendor/cpriego/valet-linux/server.php", client: 127.0.0.1, server: , request: "GET /media/plg_quickicon_extensionupdate/js/extensionupdatecheck.js?95ac38c67651723d445944ba719bf971 HTTP/1.1"...

 nginx                     1 answers                     84 view
 2018-10-21         Phil

Enable nginx module on Laravel Homestead?

How can I install and enable the file upload and upload progress module on nginx with the Laravel Homestead box on Vagrant? I believe all you need to do, like it was mentioned above, is log in with ssh to your box and install the nginx-extras package. So:Got to your Homestead directory.Do 'vagrant ssh'Once in do 'sudo apt-get install nginx-extras'Restart nginx with 'sudo service nginx restart'Check for the module in the output of 'sudo nginx -V'. Messy but you should see 'nginx-upload-progress' somewhere near the end of the output. [XXX]You can do everything via ssh...

 nginx                     2 answers                     86 view
 2018-10-22         Sidney

Accessing NGINX virtual host in local network

I would like to access a virtual host on my dev workstation (Arch Linux) from mobile or tablet connected in the same network.My nginx.conf virtual host spec looks like this:http {include mime.types;default_type application/octet-stream;sendfile on;keepalive_timeout 65;client_max_body_size 16M;# Domain site1.devserver { server_name site1.dev; listen 80; root /path/to/dir; location / { root /path/to/dir; index index.php; try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { fastcgi_pass unix:/run/php-fpm/php-fpm.sock; ...

 nginx                     2 answers                     69 view
 2018-10-22         Elsa

Nginx two virtual hosts on with domain name one in localhost

On my Nginx I've got two hosts.One with the valuesserver_name = www.mydomain.com;root /var/www/production/myFirstWebSite; and the other with server_name=localhost;root /var/www/development/mySecondWebSite;To my domain registrar account I configured the DNS with two A record "www IN A myIP IN A myIPThis is cool, i can reach my first website with www.mydomain.com or mydomain.com.Now the problem is how to reach my second website which is in development and I don't buy the domain name. And myIP/development/myScondWebSite is no more working ...I think that the problem come f...

 nginx                     1 answers                     70 view
 2018-10-22         Sabrina

Ubuntu Nginx - changing the server root directory

I really depends on changing the server root directory from /var/www to the /srv/http.Because if I sue:server { server_name www.domain.tld; root /srv/http/project/web; location / { # try to serve file directly, fallback to app.php try_files $uri /app.php$is_args$args; } # DEV # This rule should only be placed on your development environment # In production, don't include this and don't deploy app_dev.php or config.php location ~ ^/(app_dev|config)\.php(/|$) { fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; fastcgi_split_pa...

 nginx                     1 answers                     11 view
 2018-10-22         Phil

Nginx and gunicorn err 403 on third-domain request

In my nginx server i set my nginx.conf like this for using with gunicorn (and a django app):server { server_name *.mytest.io; root /var/www;}server { listen 80 default_server; listen [::]:80 default_server; server_name ~^(?<account>.+)\.mytest\.io$; root /var/www;#add_header Test $account; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location /static/ { alias /var/www/web/core/frontend/static/; } location / { proxy_pass http://127.0.0.1:8...

 nginx                     1 answers                     56 view

Page 1 of 124  |  Show More Pages:  Top Prev Next Last