Skip to content

Instantly share code, notes, and snippets.

@sarog

sarog/mdm.conf Secret

Last active December 16, 2021 18:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sarog/2b8b43ca5f1b97071f46138e0d1ea0ee to your computer and use it in GitHub Desktop.
Save sarog/2b8b43ca5f1b97071f46138e0d1ea0ee to your computer and use it in GitHub Desktop.
MobiControl with nginx as a reverse proxy
server {
server_name mdm.example.com;
root "/usr/home/mc/www/public";
# return 301 https://$host$request_uri;
}
server {
# listen 443 ssl http2 accept_filter=dataready;
listen [::]:443 ssl http2;
listen 443 ssl http2;
server_name mdm.example.com;
charset utf-8;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 600s;
proxy_redirect https://mdm-01.example.local/ https://$host/;
proxy_pass https://mdm-01.example.local/;
access_log /var/log/nginx/mdm-access.log;
error_log /var/log/nginx/mdm-error.log;
}
location ~ /\.ht {
deny all;
}
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:100m;
ssl_session_timeout 1d;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
ssl_certificate /usr/local/etc/letsencrypt/live/mdm.example.com/fullchain.pem;
ssl_certificate_key /usr/local/etc/letsencrypt/live/mdm.example.com/privkey.pem;
add_header Strict-Transport-Security "max-age=16070400; includeSubdomains";
}
user www;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 4096;
}
http {
include 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;
types_hash_max_size 2048;
# server_tokens off;
server_names_hash_bucket_size 64;
large_client_header_buffers 4 8k;
client_max_body_size 20M;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
gzip on;
gzip_disable "msie6";
# Update your allowed TLS versions here
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
include /usr/local/etc/nginx/vhosts/*.conf;
}
@airwave539
Copy link

This is great help but I'm having issues with windows modern not finishing enrollment, it appears to be related to windows getting a forbidden error while trying to connect to its assigned Management server address... ie. "https://my.server.here/DeviceManagement.svc/WindowsDesktop/Windows%2010%20RS1/sequenciallyGeneratedNumber. wondering if you can be of any assistance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment