Page History
...
13. How can I access SQL DM for MySQL pages proxying through nginx?
A: You can also access SQL DM for MySQL using nginx proxy. You need to follow these simple steps to configure your nginx server to support proxy. Here, we will setup Proxy in system A and we assume that SQL DM for MySQL is installed in system B, now you can access SQL DM for MySQL both over HTTP("http://") and HTTPS("https://").
...
- Install nginx on your system.
- Create directories
a. /var/log/nginx
b. /var/www/cache - Configure nginx: Open nginx.conf found in /etc/nginx and add the following in the http section:
...
Code Block | ||
---|---|---|
| ||
proxy_cache_ |
...
path /var/www/cache levels=1:2 keys_zone=my-cache:8m max_size=1000m inactive=600m; |
...
proxy_temp_path /var/www/cache/tmp; |
A sample nginx.conf would like the following:
...
Code Block | ||
---|---|---|
| ||
user nginx; |
...
worker_ |
...
processes 1; |
...
error_ |
...
log /var/log/nginx/error.log debug; |
...
pid /var/run/nginx.pid; |
...
events { |
...
worker_ |
...
connections 1024; |
...
} |
...
http { |
...
include /etc/nginx/mime.types; |
...
default_ |
...
type application/octet-stream; |
...
log_ |
...
format main |
...
'$remote_addr - $remote_user [$time_local] "$request" ' |
...
...
'$status $body_bytes_sent "$http_referer" ' |
...
'"$http_user_agent" "$http_x_forwarded_for"'; |
...
access_ |
...
log /var/log/nginx/access. |
...
log main; |
...
...
|
...
#tcp_nopush on;
keepalive_timeout 0;
...
sendfile on; #tcp_nopush on; keepalive_timeout 0; proxy_cache_ |
...
path /var/www/cache levels=1:2 keys_zone=my-cache:8m max_size=1000m inactive=600m; |
...
proxy_temp_path /var/www/cache/tmp; |
...
include /etc/nginx/conf.d/*.conf; |
...
} |
4. Put your SSL certificates in /etc/nginx/conf/
5. Create a monyog.conf file inside /etc/nginx/conf.d/ and add the following:
server {
...
Code Block | ||
---|---|---|
| ||
server { server_name _; |
...
listen 80; |
...
location / { |
...
proxy_pass http://<ip-system-b>:5555; |
...
12.
proxy_redirect off;
...
proxy_redirect off; proxy_cache my-cache; |
...
proxy_cache_ |
...
valid 200 302 |
...
0m; |
...
15.
proxy_cache_valid 404 0m;
16.
proxy_set_header Host $host;
17.
proxy_set_header X-Real-IP $remote_addr;
...
proxy_cache_valid 404 0m; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
...
proxy_max_temp_file_size 0; |
...
client_max_body_ |
...
size 10m; |
...
client_body_buffer_ |
...
size 128k; |
...
22.
proxy_connect_timeout 9000;
23.
proxy_send_timeout 9000;
24.
proxy_read_timeout 9000;
25.
proxy_buffer_size 4k;
26.
proxy_buffers 4 32k;
27.
proxy_busy_buffers_size 64k;
...
proxy_connect_timeout 9000; proxy_send_timeout 9000; proxy_read_timeout 9000; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; |
...
29.
}
30.
}
31.
server {
...
} } server { server_name _; |
...
33.
listen 443;
34.
ssl on;
...
listen 443; ssl on; ssl_certificate /etc/nginx/conf/<certificate_name>.crt; |
...
ssl_certificate_key /etc/nginx/conf/<certificate_key>.key; |
...
location / { |
...
proxy_pass http://<ip-system-b>:5555; |
...
proxy_redirect off; |
...
40.
proxy_cache my-cache;
...
proxy_cache my-cache; proxy_cache_valid 200 302 0m; |
...
proxy_cache_valid 404 0m; |
...
proxy_set_header Host $host; |
...
proxy_set_header X-Real-IP $remote_addr; |
...
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
...
proxy_max_temp_file_size 0; |
...
client_max_body_size 10m; |
...
client_body_buffer_size 128k; |
...
proxy_connect_timeout 9000; |
...
50.
proxy_send_timeout 9000;
...
proxy_send_timeout 9000; proxy_read_timeout 9000; |
...
proxy_buffer_size 4k; |
...
proxy_buffers 4 32k; |
...
proxy_busy_buffers_size 64k; |
...
proxy_temp_file_write_size 64k; |
...
56.
}
...
} } |
14. Can I access SQL DM for MySQL pages using encrypted connection such as "https"?
...