Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lines of config are deleted from the file on format #24

Open
technatelogy opened this issue Sep 18, 2024 · 0 comments
Open

Lines of config are deleted from the file on format #24

technatelogy opened this issue Sep 18, 2024 · 0 comments

Comments

@technatelogy
Copy link

technatelogy commented Sep 18, 2024

Required information for this issue:

  • Your VS Code Version: 1.93
  • Your OS Version: Win 11
  • Is this extension running on VS Code Remote or https://vscode.dev: No, local.

Steps to Reproduce:

  1. Create a new default.conf file.
  2. Paste the contents from this example on Digital Ocean
server {
    listen 80;
    server_name server_domain_or_IP;
    root /var/www/travellist/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.html index.htm index.php;

    charset utf-8;

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

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}
  1. Format the document and see that the last 4 lines of code are removed.
server {
  listen 80;
  server_name server_domain_or_IP;
  root /var/www/travellist/public;

  add_header X-Frame-Options "SAMEORIGIN";
  add_header X-XSS-Protection "1; mode=block";
  add_header X-Content-Type-Options "nosniff";

  index index.html index.htm index.php;

  charset utf-8;

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

  location = /favicon.ico {
    access_log off; log_not_found off;
  }
  location = /robots.txt {
    access_log off; log_not_found off;
  }

  error_page 404 /index.php;

  location ~ \.php$ {
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
    include fastcgi_params;
  }

I'm pretty sure it has to do with these two lines:

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

After they are split onto their own lines the bottom lines are removed.

@technatelogy technatelogy changed the title Lines are deleted from the file on format Lines of config are deleted from the file on format Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant