globaltrendz

 hetiacp 


nginx


and php-fpm

 systemctl restart php8.2-fpm


mkdir -p /run/php/


systemctl status php8.2-fpm


root@server4:/var/log# cd php8.2-fpm.log

php8.2-fpm.log       php8.2-fpm.log.1     php8.2-fpm.log.2.gz  php8.2-fpm.log.3.gz




/usr/local/hestia/log

error.log


2025-02-04 04:54:09 v-update-sys-hestia  'hestia-nginx' [Error 19]

2025-02-04 04:54:44 v-update-sys-hestia  'hestia-php' [Error 19]

2025-02-05 04:40:24 v-update-sys-hestia  'hestia' [Error 19]

2025-02-05 04:40:45 v-update-sys-hestia  'hestia-nginx' [Error 19]

2025-02-05 04:41:06 v-update-sys-hestia  'hestia-php' [Error 19]

2025-02-06 04:49:45 v-restart-service  'nginx' 'yes' [Error 20]

2025-02-06 04:49:48 v-restart-web  'yes' [Error 20]

2025-02-06 04:49:49 v-restart-service  'php8.2-fpm' 'yes' [Error 20]


i want to add these lines, location /api-grub { proxy_pass http://127.0.0.1:8033; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection ‘upgrade’; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } , in config file nginx.ssl.conf where should I do it so that upon update the changes remains there


In HestiaCP, manually editing the nginx.ssl.conf file is not recommended because updates and rebuilds can overwrite your changes. Instead, you should use a custom template to ensure that your configuration remains persistent even after updates.

Steps to Add a Persistent Nginx Configuration in HestiaCP

1. Create a Custom Nginx Template

HestiaCP stores Nginx templates in /usr/local/hestia/data/templates/web/nginx/. To create a custom template:

bash
cd /usr/local/hestia/data/templates/web/nginx/ cp default.stpl custom-api-grub.stpl cp default.tpl custom-api-grub.tpl

inside folder

/usr/local/hestia/data/templates/web/nginx/php-fpm

If you’re using SSL, also copy the .sstpl file:

bash
cp default.sstpl custom-api-grub.sstpl


2. Edit the Custom Template

Now, open the copied template (custom-api-grub.sstpl) with a text editor:

bash
nano custom-api-grub.sstpl

Find the location / block and add your custom location /api-grub block inside the server {} directive, just before the last closing }.

Example (custom-api-grub.sstpl):

nginx
server { listen 443 ssl; server_name %domain_idn%; location /api-grub { proxy_pass http://127.0.0.1:8033; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*; }

Save the file (CTRL + X, then Y, then Enter).

3. Apply the Custom Template to Your Domain

  1. Log in to HestiaCP.
  2. Go to WebEdit your domain.
  3. Change the Nginx Template to custom-api-grub.
  4. Save the settings.

4. Restart Nginx to Apply Changes

bash
systemctl restart nginx

Now, your custom configuration will remain even after HestiaCP updates. 🚀



Comments

Popular posts from this blog

How to install zimbra collaboration suite 8.8.11 on CentOS 7

cpanel exam CPSP Answers

awstats installation