A
A
Alex Goncharov2020-08-28 11:51:21
caching
Alex Goncharov, 2020-08-28 11:51:21

How to run Ngnix + Varnish on Cent OS 7?

Can't run Varnish next to Ngnix. I get an error: https://skr.sh/s3sNqQg4Owp

CentOS 7
nginx/1.16.1
varnish-5.2.1 revision 67e562482)
PHP 7.4

Registered in the Varnish config
/etc/varnish/default.vcl 80 port Config
screenshot: https:// skr.sh/s3sUjM2czd5

In the config for Ngnix ngnix.conf
- port 8080
Screenshot of the config: https://skr.sh/s3sVzpLGdmQ

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
paran0id, 2020-08-28
@paran0id

Try to stop nginx, start varnish, start nginx.
You can see which process is listening on the port with the commandlsof -i tcp:80

A
Aleksandr Kuznetsov, 2020-08-28
@x_T

First, it is worth figuring out what and on which port you want to hang.
If Nginx is on 8080, then .port = "8080" should be written in /etc/varnish/default.vcl - this is the backend setting, that is, what Varnish will access for content, and not the port Varnish listens to. The latter in Centos 7 can be configured in /etc/varnish/varnish.params and in the systemd service file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question