Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Apache 2.4 konfiguracja proxy, Problem z konfiguracją -> obecna nie działa
michalprog
post 6.07.2022, 09:37:33
Post #1





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 16.01.2012

Ostrzeżenie: (0%)
-----


Bry!

Mam problem z konfiguracją strony na Apache2. Używam systemu Ubuntu 20.04.4 LTS.

Chodzi o ustawienie Proxy na serwer z aplikacją, Strona ma działać na SSL i przekierowywać na apkę, która nie działa już na SSL.

Nie wiem gdzie leży błąd w moim configu, jako, że nie wiem jak to sprawić. Apache nie zwraca błędów. Załączam mój config:

[APACHE] pobierz, plaintext
  1. <VirtualHost *:9975>
  2.  
  3. ServerAdmin webmaster@localhost
  4. DocumentRoot /var/www/html
  5. ErrorLog ${APACHE_LOG_DIR}/error.log
  6. CustomLog ${APACHE_LOG_DIR}/access.log combined
  7.  
  8. SSLEngine On
  9.  
  10. SSLCertificateFile /path/to/cert/cer.crt
  11. SSLCertificateKeyFile /path/to/cert/cer.key
  12.  
  13. ProxyPassReverse / http://127.0.0.1:9999/appDir/
  14. </VirtualHost>
[APACHE] pobierz, plaintext


Wszedłem pod adres http://127.0.0.1:9999/appDir/ i wiem, że działa pod nim apka, mam z niej info zwrotne.

Certyfikaty są takie same jak na innej stronie, którą też hostuje lokalnie.

Co robię źle?

Na nginx działa wszystko dobrze. Jako, że główną apkę mam na apache, muszę przepisać config z nginx do apache. Oczywiście nginx wyłączam przed uruchomieniem apache.

config nginx:

  1. server {
  2. listen 9975 http2 ssl;
  3. listen [::]:9975 http2 ssl;
  4.  
  5. server_name localhost;
  6.  
  7. ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
  8. ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
  9. ssl_dhparam /etc/ssl/certs/dhparam.pem;
  10.  
  11. ########################################################################
  12. ########################################################################
  13.  
  14. ssl_protocols TLSv1.3;# Requires nginx >= 1.13.0 else use TLSv1.2
  15. ssl_prefer_server_ciphers on;
  16. ssl_ciphers blah;
  17. ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
  18. ssl_session_timeout 10m;
  19. ssl_session_cache shared:SSL:10m;
  20. ssl_session_tickets off; # Requires nginx >= 1.5.9
  21. ssl_stapling on; # Requires nginx >= 1.3.7
  22. ssl_stapling_verify on; # Requires nginx => 1.3.7
  23. resolver 8.8.8.8 8.8.4.4 valid=300s;
  24. resolver_timeout 5s;
  25. # Disable preloading HSTS for now. You can use the commented out header line that includes
  26. # the "preload" directive if you understand the implications.
  27. #add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
  28. add_header X-Frame-Options DENY;
  29. add_header X-Content-Type-Options nosniff;
  30. add_header X-XSS-Protection "1; mode=block";
  31. ##################################
  32. # END https://cipherlist.eu/ BLOCK #
  33. ##################################
  34.  
  35. root /var/www/html/html;
  36.  
  37. location / {
  38. proxy_http_version 1.1;
  39. proxy_set_header Upgrade $http_upgrade;
  40. proxy_set_header Connection "Upgrade";
  41. proxy_set_header Host $host;
  42. proxy_pass [url="http://127.0.0.1:9999/appDir/;"]http://127.0.0.1:9999/appDir/;[/url]
  43. }
  44.  
  45. error_page 404 /404.html;
  46. location = /404.html {
  47. }
  48.  
  49. error_page 500 502 503 504 /50x.html;
  50. location = /50x.html {
  51. }
  52.  
  53. }


(przepraszam, nie ma jak oznaczyć kodu, gdyż nie posiadacie ustawienia NGinx do kolorowania składni
Proszę o pomoc
Dzięki

Ten post edytował michalprog 6.07.2022, 09:38:13
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 27.04.2024 - 10:35