iam_production_deployment_guide
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| iam_production_deployment_guide [2026/02/26 10:14] – [Proxy through NGINX] pradnya | iam_production_deployment_guide [2026/02/26 12:47] (current) – [cPanel's userdata include] pradnya | ||
|---|---|---|---|
| Line 331: | Line 331: | ||
| </ | </ | ||
| - | ===== Proxy through NGINX ===== | + | ===== Proxy through NGINX - Droplet FIX ===== |
| To resolve on browser error "We are sorry… HTTPS required" | To resolve on browser error "We are sorry… HTTPS required" | ||
| Line 403: | Line 403: | ||
| < | < | ||
| - | + | keycloak: | |
| - | keycloak:\\ | + | image: quay.io/ |
| - | image: quay.io/ | + | container_name: |
| - | container_name: | + | command: start |
| - | command: start\\ | + | ports: |
| - | ports:\\ | + | - " |
| - | - " | + | environment: |
| - | environment: | + | KC_DB: postgres |
| - | KC_DB: postgres\\ | + | KC_DB_URL: jdbc: |
| - | KC_DB_URL: jdbc: | + | KC_DB_USERNAME: |
| - | KC_DB_USERNAME: | + | KC_DB_PASSWORD: |
| - | KC_DB_PASSWORD: | + | KC_BOOTSTRAP_ADMIN_USERNAME: |
| - | KC_BOOTSTRAP_ADMIN_USERNAME: | + | KC_BOOTSTRAP_ADMIN_PASSWORD: |
| - | KC_BOOTSTRAP_ADMIN_PASSWORD: | + | KC_HTTP_ENABLED: |
| - | KC_HTTP_ENABLED: | + | KC_HTTP_PORT: |
| - | KC_HTTP_PORT: | + | KC_PROXY_HEADERS: |
| - | KC_PROXY_HEADERS: | + | KC_HOSTNAME: |
| - | KC_HOSTNAME: | + | |
| KC_HOSTNAME_STRICT: | KC_HOSTNAME_STRICT: | ||
| + | </ | ||
| + | |||
| + | Start NginX | ||
| + | |||
| + | < | ||
| + | systemctl restart nginx | ||
| </ | </ | ||
| + | |||
| + | Check/ | ||
| + | |||
| + | **Configure Inbound Rules** | ||
| + | |||
| + | Add these inbound rules: | ||
| + | |||
| + | ^Type^Protocol^Port^Sources| | ||
| + | |HTTP|TCP|80|All IPv4, All IPv6| | ||
| + | |HTTPS|TCP|443|All IPv4, All IPv6| | ||
| + | |SSH|TCP|22| \\ All IPv4, All IPv6| | ||
| + | |||
| + | Allow Nginx to connect to local ports | ||
| + | < | ||
| + | |||
| + | | ||
| + | |||
| + | #or | ||
| + | |||
| + | setenforce 1 | ||
| + | |||
| + | </ | ||
| + | |||
| + | Stop docker and NginX and start again. | ||
| + | |||
| + | ===== cPanel' | ||
| + | |||
| + | **Step 1: Create the userdata directories** | ||
| + | |||
| + | bash | ||
| + | |||
| + | < | ||
| + | mkdir -p / | ||
| + | mkdir -p / | ||
| + | |||
| + | </ | ||
| + | |||
| + | **Step 2: Create HTTP proxy config** | ||
| + | |||
| + | bash | ||
| + | |||
| + | < | ||
| + | nano / | ||
| + | |||
| + | </ | ||
| + | |||
| + | Add: | ||
| + | |||
| + | < | ||
| + | RewriteEngine On RewriteRule ^(.*)$ https:// | ||
| + | |||
| + | **Step 3: Create HTTPS proxy config** | ||
| + | |||
| + | bash | ||
| + | |||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | Add: | ||
| + | |||
| + | < | ||
| + | ProxyPreserveHost On\ | ||
| + | ProxyPass / http:// | ||
| + | ProxyPassReverse / http:// | ||
| + | RequestHeader set X-Forwarded-Proto " | ||
| + | RequestHeader set X-Forwarded-Port " | ||
| + | |||
| + | </ | ||
| + | |||
| + | **Step 4: Rebuild Apache config and restart** | ||
| + | |||
| + | bash | ||
| + | |||
| + | < | ||
| + | / | ||
| + | httpd -t | ||
| + | systemctl restart httpd | ||
| + | |||
| + | </ | ||
| + | |||
| + | Then test: | ||
| + | |||
| + | bash | ||
| + | |||
| + | < | ||
| + | curl -I https:// | ||
| + | |||
| + | </ | ||
| + | |||
| + | Expected result: | ||
| + | |||
| + | < | ||
| + | curl -I [[https:// | ||
| + | |||
| + | HTTP/1.1 302 Found Date: Thu, 26 Feb 2026 11:22:25 GMT | ||
| + | |||
| + | Server: Apache | ||
| + | |||
| + | Location: [[https:// | ||
| + | |||
| + | Referrer-Policy: | ||
| + | |||
| + | Strict-Transport-Security: | ||
| + | |||
| + | X-Content-Type-Options: | ||
| + | |||
| + | X-XSS-Protection: | ||
| + | |||
| + | mode=block | ||
| + | |||
| + | </ | ||
| + | |||
| + | Check for **Location: https:// | ||
| + | |||
| + | This is poining to correct directory and not apache direcoty with cgi folder. | ||
iam_production_deployment_guide.1772100866.txt.gz · Last modified: by pradnya
