I have a Kubernetes deployment with ingress for a service that include Apache for backend php and should provide an Angular app
the url is : "ip/app2
the issue is when the SSL is on i got "net::ERR_FAILED". for javascript files of for network issues so the app could not fetch the files
page:297 GET https://url/app1/test.js?60f67dda8d8a5 net::ERR_FAILED
sometimes it works when refreshing the page and sometimes no. An app without Apache (just static app that runs on react) works great from the root URL : IP
Configuration :
app1 container ports:
name: app1
ports:
- containerPort: 8080
name: app1
protocol: TCP
app1 ingress/service :
/app1(/|$)(.*). -> 8080
annotations:
field.cattle.io/ingressState
{}
kubernetes.io/ingress.class
nginx
meta.helm.sh/release-name
service-name
nginx.ingress.kubernetes.io/force-ssl-redirect
true
nginx.ingress.kubernetes.io/rewrite-target
/$2
in container apache conf : (there is no htacess in the project)
<VirtualHost *:8080>
DocumentRoot /var/www/html/code
<Directory /var/www/html/code>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
</Directory>
</VirtualHost>
the same services works perfectly in local env or in Docker env with nginx
the old nginx conf that works in docker is:
location /app1 {
proxy_pass http://service:8080/;
limit_req zone=gateway_limit burst=100 nodelay;
# Force path '/' to only use https
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
if ($scheme = http) {
return 301 https://$host$request_uri;
}
}