Commit 21cf8709 by Feanil Patel

Add the robots section if a robots file exists.

parent fb8f3c51
...@@ -66,6 +66,8 @@ server { ...@@ -66,6 +66,8 @@ server {
try_files $uri @proxy_to_cms_app; try_files $uri @proxy_to_cms_app;
} }
{% include "robots.j2" %}
# Check security on this # Check security on this
location ~ /static/(?P<file>.*) { location ~ /static/(?P<file>.*) {
root {{ edxapp_data_dir }}; root {{ edxapp_data_dir }};
......
...@@ -12,5 +12,7 @@ server { ...@@ -12,5 +12,7 @@ server {
proxy_set_header X-outside-url $scheme://$host; proxy_set_header X-outside-url $scheme://$host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
} }
{% include robots.j2 %}
} }
...@@ -40,6 +40,8 @@ server { ...@@ -40,6 +40,8 @@ server {
try_files $uri @proxy_to_app; try_files $uri @proxy_to_app;
} }
{% include "robots.j2" %}
location @proxy_to_app { location @proxy_to_app {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port; proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
......
...@@ -46,6 +46,8 @@ server { ...@@ -46,6 +46,8 @@ server {
try_files $uri @proxy_to_lms-preview_app; try_files $uri @proxy_to_lms-preview_app;
} }
{% include "robots.j2" %}
# Check security on this # Check security on this
location ~ /static/(?P<file>.*) { location ~ /static/(?P<file>.*) {
root {{ edxapp_data_dir}}; root {{ edxapp_data_dir}};
......
...@@ -62,6 +62,8 @@ server { ...@@ -62,6 +62,8 @@ server {
try_files $uri @proxy_to_lms_app; try_files $uri @proxy_to_lms_app;
} }
{% include "robots.j2" %}
# Check security on this # Check security on this
location ~ /static/(?P<file>.*) { location ~ /static/(?P<file>.*) {
root {{ edxapp_data_dir }}; root {{ edxapp_data_dir }};
......
...@@ -31,6 +31,8 @@ server { ...@@ -31,6 +31,8 @@ server {
expires epoch; expires epoch;
} }
{% include "robots.j2" %}
location @proxy_to_app { location @proxy_to_app {
client_max_body_size 75K; client_max_body_size 75K;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
......
{% if NGINX_ROBOT_RULES|length > 0 %}
location /robots.txt {
root {{ nginx_app_dir }};
try_files $uri /robots.txt =404;
}
{% endif %}
...@@ -17,6 +17,8 @@ server { ...@@ -17,6 +17,8 @@ server {
try_files $uri @proxy_to_app; try_files $uri @proxy_to_app;
} }
{% include "robots.j2" %}
location @proxy_to_app { location @proxy_to_app {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port; proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment