How to configure nginx reverse proxy to apache?

0 like 0 dislike
8 views
Is there a site to spin on apache. There's also installed nginx. system centos. can't configure nginx as a reverse proxy. mistake 502. the site local address works great (192.168.1.3:8080). to address 192.168.1.3:80 out test page nginx.
nginx.conf
spoiler
user nginx; worker_processes 10; error_log /var/log/nginx/error.log debug; pid /var/run/nginx.pid; events { worker_connections 20000; } http { include /etc/nginx/mime.types; default_type application/octet-stream; "log_format" main '$remote_addr - $remote_user [$}#] $status' '"$request" $body_bytes_sent "$http_referer"' '"$http_user_agent" "http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 30; timeout 900; server_tokens off; server { listen 192.168.1.3:80; server_name mysite.ru www.mysite.ru; charset UTF-8; error_page 404 = @fallback; location / { proxy_pass http://127.0.0.1:8080; "proxy_redirect" off; proxy_set_header Host $Host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_buffer_size 8k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 10m; } location ~ * ^.+\\.(bmp|jpg|jpeg|gif|ico|png|css|doc|txt|js|zip|iso|tgz|gz|rar|bz2|7z|xls|exe|pdf|ppt|tar|wav|avi|rtf|mp3|mp4|mov|mpeg|mpg|eot|ttf|woff|woff2)$ { expires 300d; root /var/www/html/mysite.EN; "proxy_redirect" off; access_log off; } location @fallback { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $Host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; } } }
by | 8 views

1 Answer

0 like 0 dislike
It's running SELinux.
To disable the restriction.
setsebool-P httpd_can_network_connect 1
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked May 20, 2019 by makarovpro
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,696 users