[et_pb_section admin_label=”section”]
[et_pb_row admin_label=”row”]
[et_pb_column type=”4_4″][et_pb_text admin_label=”Text”][code language=”bash”]
upstream mysite_app {
server unix:///home/ubuntu/mysite/shared/sockets/puma.sock;
}
server {
listen 80;
server_name mydomain.com;
root /home/ubuntu/mysite/public;
try_files $uri/index.html $uri @mysite_app;
location / {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Connection ”;
proxy_pass http://mysite_app;
## Block SQL injections
set $block_sql_injections 0;
if ($query_string ~ "union.*select.*\(") {
set $block_sql_injections 1;
}
if ($query_string ~ "union.*all.*select.*") {
set $block_sql_injections 1;
}
if ($query_string ~ "concat.*\(") {
set $block_sql_injections 1;
}
if ($block_sql_injections = 1) {
return 403;
}
}
}
[/code][/et_pb_text][/et_pb_column]
[/et_pb_row]
[/et_pb_section]