title: Nginx doesnt work on my CloudPanel Website
body: <p>Open your server's root nginx.conf file, most of the time It's located it in: /etc/nginx/nginx.conf</p>
  <p>Open the home directory of the script, you should be able to find this file (nginx.conf):</p>
  <p><a href="https://i.stack.imgur.com/sAjuv.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>I am trying to put the nginx.conf into my Vhost config</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>server {
    listen 80;
    listen [::]:80;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    {{ssl_certificate_key}}
    {{ssl_certificate}}
    server_name ian.ph;
    {{root}}
  
    {{nginx_access_log}}
    {{nginx_error_log}}
  
    if ($bad_bot = 1) {
      return 403;
    }
  
    if ($scheme != "https") {
      rewrite ^ https://$host$uri permanent;
    }
  
    location ~ /.well-known {
      auth_basic off;
      allow all;
    }
  
    {{basic_auth}}
  
    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 $fastcgi_https;
      {{php_fpm_listener}}
      {{php_settings}}
    }
    
    location / {
    if (!-e $request_filename){
      rewrite ^/$ /index.php?link1=home;
    }
    if (!-e $request_filename){
      rewrite ^/aj/([^/.]+)/?$ /ajax.php?type=$1&amp;first=$2;
    }
    rewrite ^/@([^\/]+)(\/|)$ /index.php?link1=timeline&amp;id=$1;
    if (!-e $request_filename){
      rewrite ^/([^\/]+)(\/|)$ /index.php?link1=$1;
    }
  }
  
  location /reset {
    rewrite ^/reset-password/([^\/]+)(\/|)$ /index.php?link1=reset-password&amp;code=$1;
  }
  
  location /confirm {
    rewrite ^/confirm/(.*)/(.*)$ /index.php?link1=confirm&amp;code=$1&amp;email=$2;
  }
  
  location = /two_factor_login {
    rewrite ^(.*)$ /index.php?link1=two_factor_login;
  }
  
  location = /two_factor_submit {
    rewrite ^(.*)$ /index.php?link1=two_factor_submit;
  }
  
  location /v {
    rewrite ^/v/(.*)$ /index.php?v=$1;
  }
  
  location /api {
    rewrite ^/api/v(([0-9])([.][0-9]+))(\/|)$ /api.php?v=$1;
  }
  
  location /admin {
    rewrite ^/admin-cp$ /admincp.php;
    rewrite ^/admin-cp/(.*)$ /admincp.php?page=$1;
  }
  
  location /admin-cdn/ {
    alias /admin-panel/;
  }
  
  location /videos {
    rewrite ^/videos/category/(.*)/rss(\/|)$ /index.php?link1=videos&amp;page=category&amp;id=$1&amp;feed=rss;
    rewrite ^/videos/category/(.*)/(.*)$ /index.php?link1=videos&amp;page=category&amp;id=$1&amp;sub_id=$2;
    rewrite ^/videos/category/(.*)$ /index.php?link1=videos&amp;page=category&amp;id=$1;
    rewrite ^/videos/(.*)/rss(\/|)$ /index.php?link1=videos&amp;page=$1&amp;feed=rss;
    rewrite ^/videos/(.*)$ /index.php?link1=videos&amp;page=$1;
  }
  
  location /articles {
    rewrite ^/articles(\/|)$ /index.php?link1=articles;
    rewrite ^/articles/category/(.*)(\/|)$ /index.php?link1=articles&amp;category_id=$1;
    rewrite ^/articles/read/(.*)(\/|)$ /index.php?link1=read&amp;id=$1;
  }
  
  location /aj {
    rewrite ^/aj/([^/.]+)/([^/.]+)/?$ /ajax.php?type=$1&amp;first=$2;
    rewrite ^/aj/([^/.]+)/([^/.]+)/([^/.]+)/?$ /ajax.php?type=$1&amp;first=$2&amp;second=$3;
  }
  
  location /edit {
    rewrite ^/edit-video/(.*)?$ /index.php?link1=edit-video&amp;id=$1;
  }
  location /video_text {
    rewrite ^/video_text/(.*)?$ /index.php?link1=video_text&amp;id=$1;
  }
  
  location /watch {
    rewrite ^/watch/([^\/]+)(\/|)?$ /index.php?link1=watch&amp;id=$1;
    rewrite ^/watch/([^\/]+)/list/([^\/]+)(\/|)?$ /index.php?link1=watch&amp;id=$1&amp;list=$2;
  }
  
  location /embed {
    rewrite ^/embed/(.*)?$ /index.php?link1=embed&amp;id=$1;
  }
  
  location /resend {
    rewrite ^/resend/(.*)/(.*)?$ /index.php?link1=resend&amp;id=$1&amp;u_id=$2;
  }
  
  location /redirect {
    rewrite ^/redirect/(.*)?$ /index.php?link1=redirect&amp;id=$1;
  }
  
  location /settings {
    rewrite ^/settings/(.*)/(.*)$ /index.php?link1=settings&amp;page=$1&amp;user=$2;
    rewrite ^/settings/(.*)$ /index.php?link1=settings&amp;page=$1;
  }
  
  location /terms {
    rewrite ^/terms/([^\/]+)(\/|)$ /index.php?link1=terms&amp;type=$1;
  }
  
  location /go_pro {
    rewrite ^/go_pro(\/|)$ /index.php?link1=go_pro;
  }
  
  location /ads {
    rewrite ^/ads(\/|)$ /index.php?link1=ads;
    rewrite ^/ads/create(\/|)$ /index.php?link1=create_ads;
    rewrite ^/ads/edit/(\d+)(\/|)$ /index.php?link1=edit_ads&amp;id=$1;
    rewrite ^/ads/analytics/(\d+)(\/|)$ /index.php?link1=ads_analytics&amp;id=$1;
  }
  
  location /contact {
    rewrite ^/contact-us(\/|)$ /index.php?link1=contact;
  }
  
  location /messages {
    rewrite ^/messages/(.*)$ /index.php?link1=messages&amp;id=$1;
  }
  
  location /view_analytics {
    rewrite ^/view_analytics/(.*)$ /index.php?link1=view_analytics&amp;id=$1;
  }
  
  location /video_studio {
    rewrite ^/video_studio/(.*)$ /index.php?link1=video_studio;
  }
  
  location = /comments {
    rewrite ^(.*)$ /index.php?link1=comments;
  }
  
  location = /dashboard {
    rewrite ^(.*)$ /index.php?link1=dashboard;
  }
  
  location = /popular_channels {
    rewrite ^(.*)$ /index.php?link1=popular_channels;
  }
  
  location = /create_article {
    rewrite ^(.*)$ /index.php?link1=create_article;
  }
  
  location = /my_articles {
    rewrite ^(.*)$ /index.php?link1=my_articles;
  }
  
  location /edit_articles {
    rewrite ^/edit_articles/(.*)?$ /index.php?link1=edit_articles&amp;id=$1;
  }
  
  location = /age_block {
    rewrite ^(.*)$ /index.php?link1=age_block;
  }
  
  location /site {
    rewrite ^/site-pages/(.*)$ /index.php?link1=site-pages&amp;page_name=$1;
  }
  
  location /post {
    rewrite ^/post/(.*)(\/|)$ /index.php?link1=post&amp;id=$1;
  }
  
  location /edit_activity {
    rewrite ^/edit_activity/(.*)(\/|)$ /index.php?link1=edit_activity&amp;id=$1;
  }
  
    location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ {
      add_header Access-Control-Allow-Origin "*";
      expires max;
      access_log off;
    }
  
    if (-f $request_filename) {
      break;
    }
  }</code></pre>
  </div>
  </div>
  </p>
  <p>But stil doesnt work</p>
  <p>Can someone please help me how i can put my nginx.conf into server</p>
  <p>Heres my nginx.conf <a href="https://pastebin.com/raw/cx2h7gRu" rel="nofollow noreferrer">https://pastebin.com/raw/cx2h7gRu</a></p>
  <p>Thanks</p>