nginx-location

nginx location and Django auth

﹥>﹥吖頭↗ 提交于 2021-01-01 07:39:45
问题 I'm trying to create a NGINX redirect based on an URL param in the querystring. Basically having: http://localhost/redirect/?url=https://www.google.it/search?dcr=0&source=hp&q=django&oq=django and location /redirect/ { proxy_cache STATIC; # cache status code 200 responses for 10 minutes proxy_cache_valid 200 1d; proxy_cache_revalidate on; proxy_cache_min_uses 3; # use the cache if there's a error on app server or it's updating from another request proxy_cache_use_stale error timeout updating

nginx location and Django auth

青春壹個敷衍的年華 提交于 2021-01-01 07:39:24
问题 I'm trying to create a NGINX redirect based on an URL param in the querystring. Basically having: http://localhost/redirect/?url=https://www.google.it/search?dcr=0&source=hp&q=django&oq=django and location /redirect/ { proxy_cache STATIC; # cache status code 200 responses for 10 minutes proxy_cache_valid 200 1d; proxy_cache_revalidate on; proxy_cache_min_uses 3; # use the cache if there's a error on app server or it's updating from another request proxy_cache_use_stale error timeout updating

How can I redirect non-www to www in https NGINX

帅比萌擦擦* 提交于 2020-12-31 06:01:40
问题 I have a question related with Nginx redirects Bellow you can see configurations. My goal is to redirect from https://example.com to https://www.example.com I looked through almost all in stackoverflow and I didn't find any help. Please help me with this issue. I will provide all necessary information about my Nginx Web Server. I hope you will help me, with this difficult question. My file nginx.conf looks like there: user www-data; worker_processes 4; pid /run/nginx.pid; events { worker

How to set proxy_http_version in LUA code before upstreaming the request in nginx

北城余情 提交于 2020-12-26 12:14:40
问题 I want to change the proxy http version in Lua code programmatically. Is there any way? Yes, I know that we can set it via the nginx config file in the location/server block. Is there any way that I can do it using Lua dynamically per request? 回答1: Updated 14.10.2020 location / { content_by_lua_block { -- some logic here if flag then return ngx.exec("@http1_0") end return ngx.exec("@http1_1") } } location @http1_0 { proxy_pass ...; proxy_http_version 1.0; ... } location @http1_1 { proxy_pass

Setup phpMyAdmin inside website subdirectory

社会主义新天地 提交于 2020-12-26 04:28:51
问题 I have an NGINX web server with two domains and it also runs phpMyAdmin. phpMyAdmin is working fine and I access it through the below non-https url: public-ip-address/phpMyAdmin This is how the symbolic link was setup: sudo ln -s /usr/share/phpmyadmin/ /var/www/html Is there a way I can point phpMyAdmin to a website's subdirectory? For example, I would like to access the phpMyAdmin login page by accessing the following URL: domain1.com/phpMyAdmin/ How can I achieve this? domain1.com has https

How setup subdomain in nginx?

我的未来我决定 提交于 2020-12-15 05:23:05
问题 I tried a few times do from the beginning but still, my subdomain doesn't work. I have ubuntu Nginx. I want to create a client-side and backend(subdomain) domain. The client-side config(work correctly): server { root /var/www/html/dist; # Add index.php to the list if you are using PHP index index.html; server_name hookahscope.com www.hookahscope.com; location ~ ^/(sitemap.xml) { root /var/www/html/public; } location / { try_files $uri /index.html; } listen [::]:443 ssl ipv6only=on; # managed

How setup subdomain in nginx?

血红的双手。 提交于 2020-12-15 05:22:27
问题 I tried a few times do from the beginning but still, my subdomain doesn't work. I have ubuntu Nginx. I want to create a client-side and backend(subdomain) domain. The client-side config(work correctly): server { root /var/www/html/dist; # Add index.php to the list if you are using PHP index index.html; server_name hookahscope.com www.hookahscope.com; location ~ ^/(sitemap.xml) { root /var/www/html/public; } location / { try_files $uri /index.html; } listen [::]:443 ssl ipv6only=on; # managed

Using nginx regex location matching to dynamically map URI's to different ports for multiple reverse proxies

你说的曾经没有我的故事 提交于 2020-12-04 03:47:00
问题 I'm using nginx to create a reverse proxy to a web app that may be behind a firewall. For my initial proof of concept I used the following location block to ensure it worked. location / { proxy_pass https://localhost:2222; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } I open up my reverse tunnel on my web app with ssh -f -N -T -R2222:localhost:443 user@nginx-ip . This works exactly as I like. I type in my nginx-ip into my browser and I get the https traffic

Using nginx regex location matching to dynamically map URI's to different ports for multiple reverse proxies

♀尐吖头ヾ 提交于 2020-12-04 03:46:35
问题 I'm using nginx to create a reverse proxy to a web app that may be behind a firewall. For my initial proof of concept I used the following location block to ensure it worked. location / { proxy_pass https://localhost:2222; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } I open up my reverse tunnel on my web app with ssh -f -N -T -R2222:localhost:443 user@nginx-ip . This works exactly as I like. I type in my nginx-ip into my browser and I get the https traffic