Nginx: Use same port for http and https traffic

This is finally possible to do properly since 1.15.2. See the information here.

your nginx.conf add a block like this (outside the http block):

stream {
    upstream http {
        server localhost:8000;
    }

    upstream https {
        server localhost:8001;
    }

    map $ssl_preread_protocol $upstream {
        default https;
        "" http;
    }

    server {
        listen 8080;
        listen [::]:8080;
        proxy_pass $upstream;
        ssl_preread on;
    }
}

Then you can create your normal server block, but listening on these different ports:

server {
    listen 8000;
    listen [::]:8000;
    listen 8001 ssl;
    listen [::]:8001 ssl;
...

Watch Netflix 4K HDR on Dell OLED monitor AW3423DW

I just purchased a Dell OLED monitor AW3423DW, and I was thinking finally I can enjoy Netflix 4K on my computer not.  But, things are not easy, Netflix can only play content content in HD (1080p). And I did some research and finally got Netflix working with 4K HDR.

Here are the steps you need to do:

1. Check your Graphics cards to make sure it supports HDCP 2.2, which means the video card need to have HDMI 2.0 or DisplayPort 1.4 or higher. I’m using old Nvidia GTX980, so I can only play Netflix with 1080p…. So Upgraded it to Nvidia RTX3070.

2. Enable HDR and Enable “Play streaming HDR video” in Windows Display settings.

3. Purchase and install HEVC Video Extensions from Microsoft Store.

4. Enable “Hardware Acceleration” in Edge via Settings – System and Performance – Use Hardware Acceleration. Only Edge or Chrome can play Netflix in 4K, Firefox or Netflix App can only stream 1080p content on windows.

5. Enter edge://flags in the URL bar and open,  Find PlayReady DRM for Windows 10/11 and select Enable. Then restart Edge.

For now you should be able to watch Youtube HDR content. But to watch Netflix in 4K, there is one more step…

6. If you have multiple monitors, you need to turn off any monitor not support HDCP 2.2. For example, my old Dell UP2716d monitor only has Display port 1.2 and HDMI 1.4 which both are not support HDCP 2.2. I need to turn the off before I start Edge, otherwise Netflix will only stream in 1080p.

After complete above steps, in Edge go to edge://gpu, and search for HDCP 2.2, you should be able to see it’s shown as true.

Once you completed all these steps, use Edge to open Netflix, and search a video, for example, Stranger Things, you should be able to see HDR logo. Once you start streaming it, press CRTL+ALT+SHIFT+S, then you should be able to see video resolution is 3440*1440. If you still see 1920*1080, then it means your video is still in 1080p.

 

Fix “the app required specific feature not available on the device” and install fitness on iPad

First of all, Not all devices support Fitness app, please check apple doc for more information.

And I’m using Ipad Air 2 which in on the support list, but when try to install Fitness app, I still got error “the app required specific feature not available on the device”.

After investigation, I found out that to install Fitness App on iPad, you need to meet below requirements:

  1.  You have an apple watch paired with an iPhone.
  2.  Home app is installed on both iPhone and iPad. If you removed them like me, install them back. And then open the Home app.
  3. If different apple IDs are used on your iPhone and iPad, (for example, the iPad is for my daughter so it’s using my daughter’s apple ID). go to Home App and add both IDs into the same home. Then reboot both iPhone and iPad

Then you should be able to install Fitness App on iPad now.

 

NBN Unifi USG 3P PPPOE settings

I just switched my NBN from Telstra to Spintel.

Telstra is using DHCP while Spintel is using PPPOE. But when I configure the usrename and password for my WAN, USG can’t connect to internet.

Spent lots of time to troubleshot this issue, and then I notice that there is a log on USG

Oct 29 14:49:25 USG pppd[8094]: pppd 2.4.4 started by root, uid 0
Oct 29 14:49:25 USG pppd[8094]: Failed to create PPPoE socket: Protocol not supported
Oct 29 14:49:37 USG xl2tpd[8208]: setsockopt recvref[30]: Protocol not available

Then I realize it’s a driver issue. Looks like USG won’t load PPPOE driver without a restart. So if you are using DHCP in the past, after you change to PPPOE, you need to restart your USG.

After restart USG, all good.

Windows shown as “No internet” when it can access internet

Windows is running DNS and HTTP test against www.msftconnecttest.com  to check if it has internet connection or not. So if your internet can’t access this website, for example, in China, sometimes this domain is hijacking by GFW, then windows will show as no internet connect.

A quick fix is to disable Active Probe via modify registry.

Change below value from 1 to 0 to disable Active Probe

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet 的 EnableActiveProbing