Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.3 kB
5
Indexable
ingress:

  annotations:
    kubernetes.io/ingress.class: "nginx"
    #cert-manager.io/cluster-issuer: "clusterissuer"

    #nginx.ingress.kubernetes.io/ssl-redirect: "true"
    
    # Configure ModSecurity
    nginx.ingress.kubernetes.io/enable-modsecurity: "true"
    nginx.ingress.kubernetes.io/enable-owasp-core-rules: "true"
    nginx.ingress.kubernetes.io/modsecurity-snippet: |
       SecRequestBodyAccess On
    
    
    nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/cors-allow-origin: "capacitor://localhost, http://localhost, http://localhost:5173, https://*.domain.ru"
    nginx.ingress.kubernetes.io/cors-allow-headers: "Accept, Te, Referer, Sec-Fetch-Dest, Sec-Fetch-Mode, Sec-Fetch-Site, Accept-Language, Accept-Encoding, Access-Control-Allow-Origin, Access-Control-Allow-Methods, DNT, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Range, Connection, Authorization, AppPlatform, Credentials, Sec-Fetch-Site, Withcredentials, apptype, visitor_id, "
    nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
    nginx.ingress.kubernetes.io/cors-allow-methods: "GET, PUT, POST, DELETE, PATCH, OPTIONS"

    nginx.ingress.kubernetes.io/configuration-snippet: |
        more_set_headers "Access-Control-Allow-Origin: $http_origin";
        


spec:
  tls:
  - hosts:
    - dev.domain.ru
    secretName: ingress-cert
  rules:
  - host: dev.domain.ru
    http:
      paths:
      - backend:
          service:
            name: frontend-service
            port:
              number: 80
        path: /
        pathType: Prefix
      
      - backend:
          service:
            name: interaction-service
            port:
              number: 80
        path: /api/
        pathType: Prefix

      #- backend:
      #    service:
      #      name: authorization-ingress
      #      port:
      #        number: 7000
      #  path: /account
      #  pathType: Prefix


nginx (front):

upstream auth {
         server authorization-service.authorization.svc.cluster.local:7000;
    }


    server {
        listen 80;
        server_name  dev.domain.ru;

        root   /usr/share/nginx/html;
        index  index.html index.htm;

        location /account {
            proxy_pass http://auth;
        }