Cockpit CMS v2 with Nginx server

Hello Team,

Can Cockpit v2 be used with Nginx. Since .htaccess does not work in nginx, do I need to make any additional changes?

Best regards

Hi :wave:

Nginx should of course work. Yo can use any common config template for a php based application. Google will give you many options here.


Hi Artur,

Thanks a lot. It works. I found one working example.

server {
    listen       80;
    root /var/www/;

    access_log /var/log/nginx/;
    error_log  /var/log/nginx/ error;
    index index.html index.htm index.php;

    location / {
                try_files $uri $uri/ /index.php$is_args$args;

    location ~ \.php$ {
        # fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
        # fastcgi_index index.php;
    # enable browser caching
    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|webp)$ {
        expires 1y;
        log_not_found off;

    location ~ /\.ht {
        deny all;
    # deny direct access to files
    location ~ .sqlite$ {
        deny all;
    location ~ .yaml$ {
        deny all;
    location ~ /\.git {
      deny all;