0

The site is running on Ubuntu 16 with Nginx web server. Recently I have uploaded the new code but when I load the website still it's showing the old pages, I have removed all the files from the document root and uploaded the sample PHP file its worked. So this time I took a pull directly from the Git but, the website is not loading with the new code.

I do not configure any cache headers / CDN for the site. In the doc root, I check the files its fresh code but the site is loading the old one. I have no idea from where it is loading.

curl -I output

HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Thu, 10 Jan 2019 10:45:02 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: PHPSESSID=1j921kls7adn7apspo0c8gdngt; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache

Nginx conf file

 server {

    listen 80;
    root /var/www/site.in;
    index index.php index.html index.htm index.nginx-debian.html;

    server_name site.in www.site.in;


    access_log /var/log/nginx/site_access.log;
    error_log /var/log/nginx/site_error.log;


    location / {
try_files $uri/ $uri /index.php?$query_string;


    }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

}

I never faced this type of issue. Please suggest me how to fix this issue.

6
  • Are you sure you are accessing the correct page/server/site? Access and error logs show nothing unusual? Restarted nginx? Restarted PHP-fpm? PHP caching is most likely the issue here.
    – Lenniey
    Jan 10, 2019 at 12:25
  • @LennieyYes am accessing the correct server and the site. I could not find any info in error log, its normal. Already I restarted the Nginx, and CSS & JS files are reflecting in the site only PHP files are loading with the old code which is not present in the document root. I have no idea from where it taking that files! Now I have restarted the php service php7.1-fpm restart but still the old site is showing up.
    – Linuxian
    Jan 10, 2019 at 18:13
  • Can you restart the OS? Just to almost safely rule out some caching on it. You are sure that no caching on nginx or PHP is enabled? Can you check with nginx -T?
    – Lenniey
    Jan 11, 2019 at 8:01
  • @Lenniey I have disabled the cache adding this opcache.enable=0 in `/etc/php/7.1/fpm/conf.d/10-opcache.ini. In nginx I did not mention the cache control or expire headers. Please suggest if any files are there to disable the cache in php config?
    – Linuxian
    Jan 11, 2019 at 10:46
  • @Lenniey Also I can see these options under Zend Opcache in phpinfo page. Opcode Caching Disabled Optimization Disabled SHM Cache Enabled File Cache Disabled
    – Linuxian
    Jan 11, 2019 at 10:53

0

You must log in to answer this question.

Browse other questions tagged .