nginx

remove php file extension with nginx/php-fpm

对着背影说爱祢 提交于 2021-02-10 19:43:36
问题 maybe someone can help me with this problem. I want to remove the php extension. (i want to use grabaperch with nginx). This is the apache rewrite rule: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.php RewriteRule (.*)\.php$ /$1/ [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$ RewriteRule (.*)$ /$1/ [R=301,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)/$ $1.php [L]

Strange Nginx behavior with trailing slashes

只愿长相守 提交于 2021-02-10 18:51:54
问题 I've got a quite interesting behavior. I want to avoid trailing slashes in URL's on my site. I've put rewrite ^/(.*)/$ /$1 permanent; rule into my server block, so https://example.com/something/ , https://example.com/something//// redirect to https://example.com/something ; and https://example.com/ redirects to https://example.com But https://example.com//// is redirected to ... https://enjoygifts.ru//// (actually don't redirected, it's 200 code). Why? Here is my server block: server { listen

NGINX return 405 Not Allowed with POST method

99封情书 提交于 2021-02-10 18:10:37
问题 I have this default.conf: server { listen 443 ssl; root /etc/nginx/json/; server_name myserver.com; ssl_certificate /etc/ssl/certs/server.crt; ssl_certificate_key /etc/ssl/private/server.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; location /platform/enabler/iam/token/generate/1.0.0 { alias /etc/nginx/json/generateToken.json; } } calling the API with GET method the response is correct. calling the API with POST method the response is: <html> <head><title>405 Not

Artifactory 7.x behind nginx issue

浪子不回头ぞ 提交于 2021-02-10 17:50:54
问题 I have a fresh installation of Artifactory 7.2.1(docker based)which is working fine, but I want to access it via nginx proxy, and that's not working. my artifactory is running under http://192.168.211.207:8082/ Custom base URL is set to: http://192.168.211.207:8081/artifactory ->which is redirecting me to http://192.168.211.207:8082/ Now, I have an nginx server which is running on the same server, also via docker. When I try to access: http://192.168.211.207 -> redirects me to https://192.168

Artifactory 7.x behind nginx issue

走远了吗. 提交于 2021-02-10 17:47:06
问题 I have a fresh installation of Artifactory 7.2.1(docker based)which is working fine, but I want to access it via nginx proxy, and that's not working. my artifactory is running under http://192.168.211.207:8082/ Custom base URL is set to: http://192.168.211.207:8081/artifactory ->which is redirecting me to http://192.168.211.207:8082/ Now, I have an nginx server which is running on the same server, also via docker. When I try to access: http://192.168.211.207 -> redirects me to https://192.168

Nginx: How to match ONLY the main domain with server_name

こ雲淡風輕ζ 提交于 2021-02-10 16:55:46
问题 My goal is to redirect example.com into www.example.com without redirecting any subdomain to www . This is what I have: server { listen 443; server_name example.com; return 301 https://www.$server_name$request_uri; } With this configuration every subdomain (ex: foo.example.com ) gets redirected into www.example.com , not just the main one without subdomain ( example.com ), as I would like. I tried cleaning cache (and also doing it from other browsers) with same results. Edit: The proof that

My Angular 6 routing returns 404 after page refresh behind Nginx proxy

给你一囗甜甜゛ 提交于 2021-02-10 16:51:41
问题 I have my angular app running inside docker that exposed on port 83, and I also have a spring-boot rest app inside another docker that exposed on port 8083. In the host server I have one Nginx server that reroute every requests using below config: server { listen 80; server_name mydomain.com; location / { proxy_pass http://127.0.0.1:83; } } server { listen 80; server_name rest.mydomain.com; location / { proxy_pass http://127.0.0.1:8083; } } With above config, every request that uses mydomain

My Angular 6 routing returns 404 after page refresh behind Nginx proxy

跟風遠走 提交于 2021-02-10 16:50:40
问题 I have my angular app running inside docker that exposed on port 83, and I also have a spring-boot rest app inside another docker that exposed on port 8083. In the host server I have one Nginx server that reroute every requests using below config: server { listen 80; server_name mydomain.com; location / { proxy_pass http://127.0.0.1:83; } } server { listen 80; server_name rest.mydomain.com; location / { proxy_pass http://127.0.0.1:8083; } } With above config, every request that uses mydomain

ClusterIP: None and failing pods

懵懂的女人 提交于 2021-02-10 16:48:54
问题 I have an NGINX in front of several PODs, exposed through ClusterIP: none. NGINX is forwarding traffic to these nodes like that: upstream api { server my-api:1066; } Will this configuration distribute traffic evenly among all PODs behind the my-api hostname? Will failing PODs be removed from the hostname resolution? 回答1: The default traffic distribution for Kubernetes services is random based on the default proxy mode: iptables. (This is likely your case) In very old Kubernetes versions (<1.1

ClusterIP: None and failing pods

故事扮演 提交于 2021-02-10 16:48:10
问题 I have an NGINX in front of several PODs, exposed through ClusterIP: none. NGINX is forwarding traffic to these nodes like that: upstream api { server my-api:1066; } Will this configuration distribute traffic evenly among all PODs behind the my-api hostname? Will failing PODs be removed from the hostname resolution? 回答1: The default traffic distribution for Kubernetes services is random based on the default proxy mode: iptables. (This is likely your case) In very old Kubernetes versions (<1.1