server { listen 80; server_name x.online; error_log /var/log/nginx/vurdur-err.log; location / { proxy_pass http://xxxx; # Plesk IP adresi proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
Plesk veya cpanel de barınan bir domaine nginx reverse Proxy yapma
5
●138
- 30-01-2025, 00:20:07Başlıktan da anlayacağınız üzere plesk te barınan bir domainime yani backendime başka başka bir sunucu ile reverse proxy yapmak istiyorum fakat yapamadım daha önce normal nginx veya apache de olan backend sunucuma yaptım fakat bu şekil yapamadım daha önce yapmış olan var ise iletişime geçebilirmi acaba kullandığım konfigrasyon aşağıda fakat işe yaramıyor
- 30-01-2025, 00:28:56Albatroz adlı üyeden alıntı: mesajı görüntüle
- 30-01-2025, 01:06:37Albatroz adlı üyeden alıntı: mesajı görüntüle
server { listen {SITE_IP}:80; server_name {DOM} www.{DOM}; error_log /var/log/{DOM}_error_log; access_log /var/log/{DOM}_access_log; root {HOME}/public_html; location ~*.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$ { expires 1M; try_files $uri @backendsite; } location / { error_page 405 = @backendsite; add_header X-Cache "HIT from Backend"; proxy_pass http://{SITE_IP}:8081; include proxy.inc; } location @backendsite { internal; proxy_pass http://SITE_IP:8081; include proxy.inc; } location ~ .*\.(php|jsp|cgi|pl|py)?$ { proxy_pass http://SITE_IP:8081; include proxy.inc; } location = /robots.txt { access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; } location ~ /\. { access_log off; log_not_found off; deny all; } location ~ ~$ { access_log off; log_not_found off; deny all; } location = /apple-touch-icon.png { access_log off; log_not_found off; } location = /apple-touch-icon-precomposed.png { access_log off; log_not_found off; } location ^~ /.git { return 403; } }
- 30-01-2025, 01:18:53bu iki panelde yapmadım ama farklı panellerde yapmıştım, config dosyalarını include ettigi bir dizin olur genelde, oraya ek config dosyanızı yazarak deneyebilirsiniz.