<commit_before># Reference: http://www.starzel.de/blog/securing-plone-sites-with-https-and-nginx

upstream ${buildout:projectname}plone {
    server 127.0.0.1:${ports:instance};
}

upstream ${buildout:projectname}varnish {
    server 127.0.0.1:${ports:varnish};
}

upstream ${buildout:projectname}haproxy {
    server 127.0.0.1:${ports:haproxy};
}

upstream ${buildout:projectname}editplone {
    server 127.0.0.1:${configuration:zope-edit-port};
}

server {

    listen 80;
    server_name ${configuration:server-name};
    access_log ${configuration:nginx-log-path}/${configuration:server-name}.log;
    error_log  ${configuration:nginx-log-path}/${configuration:server-name}.error.log;

    gzip            on;
    gzip_min_length 1000;
    gzip_types      application/javascript application/json application/rss+xml application/x-javascript application/xhtml+xml application/xml application/xml+rss text/css text/html text/javascript text/plain text/xml;



    rewrite ^(.*)(/login|/require_login|/failsafe_login_form)(.*) http://${configuration:edit-server-name}$1$2$3 redirect;

    if ($http_cookie ~* "__ac=([^;]+)(?:;|$)" ) {
      rewrite ^/(.*) http://${configuration:edit-server-name}/$1 redirect;
    }

    location /robots.txt {
       return 200 "User-agent: *\n Disallow: /";
    }

    location / {
        rewrite ^/(.*)$ /VirtualHostBase/http/$host:80/Plone/VirtualHostRoot/$1 break;
        # Directly Zope
        proxy_pass http://${buildout:projectname}plone;
        # Varnish
        # proxy_pass http://${buildout:projectname}varnish;
        # HAProxy
        # proxy_pass http://${buildout:projectname}haproxy;

    }
}

server {
       # VirtualHost berezia, editoreek katxeatu gabe ikusteko
       listen 80;
       server_name ${configuration:edit-server-name};
       access_log ${configuration:nginx-log-path}/${configuration:edit-server-name}_access.log;
       error_log  ${configuration:nginx-log-path}/${configuration:edit-server-name}_error.log;

       gzip            on;
       gzip_min_length 1000;
       gzip_types      application/javascript application/json application/rss+xml application/x-javascript application/xhtml+xml application/xml application/xml+rss text/css text/html text/javascript text/plain text/xml;

       client_max_body_size 20M;


       location /robots.txt {
           return 200 "User-agent: *\nDisallow: /";
       }


       if ($http_cookie ~* "__ac=([^;]+)(?:;|$)" ) {
           # prevent infinite recursions between http and https
       break;
       }
       rewrite ^(.*)(/logged_out)(.*) http://${configuration:server-name}$1$2$3 redirect;

       location / {
            rewrite ^/(.*)$ /VirtualHostBase/http/$host:80/Plone/VirtualHostRoot/$1 break;
            proxy_pass http://${buildout:projectname}editplone;
       }

       set $redirect_to_http "1";
       if ($http_cookie ~* "__ac=([^;]+)(?:;|$)" ) {
          set $redirect_to_http "";
       }
       if ($uri ~* "(/login|/login_form|/require_login|/failsafe_login_form|logged_out)" ) {
          set $redirect_to_http "";
       }
       if ($redirect_to_http = "1") {
          rewrite ^(.*) http://${configuration:server-name}$1 redirect;
       }


}

server {

   listen 80;
   server_name ${configuration:additional-names};
   return 301 $scheme://${configuration:server-name}$request_uri;
}
<commit_msg>remove the robots.txt config file<commit_after># Reference: http://www.starzel.de/blog/securing-plone-sites-with-https-and-nginx

upstream ${buildout:projectname}plone {
    server 127.0.0.1:${ports:instance};
}

upstream ${buildout:projectname}varnish {
    server 127.0.0.1:${ports:varnish};
}

upstream ${buildout:projectname}haproxy {
    server 127.0.0.1:${ports:haproxy};
}

upstream ${buildout:projectname}editplone {
    server 127.0.0.1:${configuration:zope-edit-port};
}

server {

    listen 80;
    server_name ${configuration:server-name};
    access_log ${configuration:nginx-log-path}/${configuration:server-name}.log;
    error_log  ${configuration:nginx-log-path}/${configuration:server-name}.error.log;

    gzip            on;
    gzip_min_length 1000;
    gzip_types      application/javascript application/json application/rss+xml application/x-javascript application/xhtml+xml application/xml application/xml+rss text/css text/html text/javascript text/plain text/xml;



    rewrite ^(.*)(/login|/require_login|/failsafe_login_form)(.*) http://${configuration:edit-server-name}$1$2$3 redirect;

    if ($http_cookie ~* "__ac=([^;]+)(?:;|$)" ) {
      rewrite ^/(.*) http://${configuration:edit-server-name}/$1 redirect;
    }

    location / {
        rewrite ^/(.*)$ /VirtualHostBase/http/$host:80/Plone/VirtualHostRoot/$1 break;
        # Directly Zope
        proxy_pass http://${buildout:projectname}plone;
        # Varnish
        # proxy_pass http://${buildout:projectname}varnish;
        # HAProxy
        # proxy_pass http://${buildout:projectname}haproxy;

    }
}

server {
       # VirtualHost berezia, editoreek katxeatu gabe ikusteko
       listen 80;
       server_name ${configuration:edit-server-name};
       access_log ${configuration:nginx-log-path}/${configuration:edit-server-name}_access.log;
       error_log  ${configuration:nginx-log-path}/${configuration:edit-server-name}_error.log;

       gzip            on;
       gzip_min_length 1000;
       gzip_types      application/javascript application/json application/rss+xml application/x-javascript application/xhtml+xml application/xml application/xml+rss text/css text/html text/javascript text/plain text/xml;

       client_max_body_size 20M;


       location /robots.txt {
           return 200 "User-agent: *\nDisallow: /";
       }


       if ($http_cookie ~* "__ac=([^;]+)(?:;|$)" ) {
           # prevent infinite recursions between http and https
       break;
       }
       rewrite ^(.*)(/logged_out)(.*) http://${configuration:server-name}$1$2$3 redirect;

       location / {
            rewrite ^/(.*)$ /VirtualHostBase/http/$host:80/Plone/VirtualHostRoot/$1 break;
            proxy_pass http://${buildout:projectname}editplone;
       }

       set $redirect_to_http "1";
       if ($http_cookie ~* "__ac=([^;]+)(?:;|$)" ) {
          set $redirect_to_http "";
       }
       if ($uri ~* "(/login|/login_form|/require_login|/failsafe_login_form|logged_out)" ) {
          set $redirect_to_http "";
       }
       if ($redirect_to_http = "1") {
          rewrite ^(.*) http://${configuration:server-name}$1 redirect;
       }


}

server {

   listen 80;
   server_name ${configuration:additional-names};
   return 301 $scheme://${configuration:server-name}$request_uri;
}

{'fraction_non_alphanumeric': 0.15481737562002104, 'fraction_numerical': 0.019089132722080265, 'mean_word_length': 3.0947692307692307, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 20}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1115420', 'n_tokens_mistral': 2263, 'n_tokens_neox': 2113, 'n_words': 325}