Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Lioncomputer Posted January 19, 2015 Posted January 19, 2015 Hi is there any already VCL file for config varnish work with IP.Board i turned on default varnish setting for my server ... everything went fine ..but some problems :users get logged out automatically sometimesthe online user list in boardindex was incorrect ( it means the board dont recognize some online users as a ONLINE USER with varnish) plz help
Joriz Posted January 19, 2015 Posted January 19, 2015 Can you share you config? Maybe we can see what goes wrong.Currently we only use Nginx with microcaching for guests and static files (such as stylesheets). It gave our forum a big speed improvement.
Lioncomputer Posted January 19, 2015 Author Posted January 19, 2015 what is microcaching and how can i enable it ?varnish Config :# # This is an example VCL file for Varnish. # # It does not do anything by default, delegating control to the # builtin VCL. The builtin VCL is called when there is no explicit # return statement. # # See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/ # and http://varnish-cache.org/trac/wiki/VCLExamples for more examples. # Marker to tell the VCL compiler that this VCL has been adapted to the # new 4.0 format. vcl 4.0; # Default backend definition. Set this to point to your content server. backend default { .host = "127.0.0.1"; .port = "8080"; } sub vcl_recv { # Happens before we check if we have this in cache already. # # Typically you clean up the request here, removing cookies you don't need, # rewriting the request, etc. } sub vcl_backend_response { # Happens after we have read the response headers from the backend. # # Here you clean the response headers, removing silly Set-Cookie headers # and other mistakes your backend does. } sub vcl_deliver { # Happens when we have all the pieces we need, and are about to send the # response to the client. # # You can do accounting or modifying the final object here. }and my nginx conf server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /var/www/lion; index index.html index.htm index.php; # Make site accessible from http://localhost/ server_name forum.lioncomputer.ir; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. #try_files $uri $uri/ =404; try_files $uri $uri/ /index.php; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # #error_page 500 502 503 504 /50x.html; #location = /50x.html { # root /usr/share/nginx/html; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini # # # With php5-cgi alone: # fastcgi_pass 127.0.0.1:9000; # # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }
Joriz Posted January 19, 2015 Posted January 19, 2015 Is this all? As far as I can see you don't even use Varnish and Nginx isn't configured to use it full potential.For tips how to configure Nginx see: http://community.invisionpower.com/topic/384522-how-to-set-up-a-secure-ipboard-installation-with-nginx-and-php-fpm/Please notice not every tip is very safe.
Lioncomputer Posted January 20, 2015 Author Posted January 20, 2015 noi just disabled the varnish ... so i change nginx conf to listen to 80 ... instead of 8080 sorry for bad config copy here is my varnished config version of nginx ;server { listen 8080 default_server; listen [::]:8080 default_server ipv6only=on; root /var/www/lion; index index.html index.htm index.php; # Make site accessible from http://localhost/ server_name forum.lioncomputer.ir; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. #try_files $uri $uri/ =404; try_files $uri $uri/ /index.php; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # #error_page 500 502 503 504 /50x.html; #location = /50x.html { # root /usr/share/nginx/html; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini # # # With php5-cgi alone: # fastcgi_pass 127.0.0.1:9000; # # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.