Skip to content

Instantly share code, notes, and snippets.

@ertugrulturan
Created November 10, 2023 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ertugrulturan/5216d83d21cd09547286f909d80e3127 to your computer and use it in GitHub Desktop.
Save ertugrulturan/5216d83d21cd09547286f909d80e3127 to your computer and use it in GitHub Desktop.
Wisecp nginx config
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate_key /etc/nginx/ssl-certificates/domainame.com.key;
ssl_certificate /etc/nginx/ssl-certificates/domainame.com.crt;
server_name domainame.com;
root /home/domaindir/htdocs/domainame.com;
access_log /home/domaindir/logs/nginx/access.log main;
error_log /home/domaindir/logs/nginx/error.log;
location ~ /.well-known {
auth_basic off;
allow all;
}
location / {
add_header Set-Cookie "Hello=World; Path=/;";
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header X-Varnish;
proxy_redirect off;
proxy_max_temp_file_size 0;
proxy_connect_timeout 720;
proxy_send_timeout 720;
proxy_read_timeout 720;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/([0-9a-zA-Z-_/.]+)$ /index.php?route=$1 last;
}
location /templates/website/images/ {
alias /home/domaindir/htdocs/domainame.com/templates/website/Classic/images/;
}
}
server {
listen 8080;
listen [::]:8080;
server_name domainame.com;
root /home/domaindir/htdocs/domainame.com;
try_files $uri $uri/ /index.php?$args;
index index.php index.html;
location ~ \.php$ {
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files $uri =404;
fastcgi_read_timeout 3600;
fastcgi_send_timeout 3600;
fastcgi_param HTTPS "on";
fastcgi_param SERVER_PORT 443;
fastcgi_pass 127.0.0.1:16001;
fastcgi_param PHP_VALUE "
error_log=/home/domaindir/logs/php/error.log;
memory_limit=512M;
max_execution_time=60;
max_input_time=60;
max_input_vars=10000;
post_max_size=64M;
upload_max_filesize=64M;
date.timezone=UTC;
display_errors=off;";
}
if (-f $request_filename) {
break;
}
}
@ertugrulturan
Copy link
Author

ertugrulturan commented Nov 10, 2023

Best Performance = Cloudpanel panel. https://www.cloudpanel.io/

domaindir = username
domainame.com = site domain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment