有没有办法在MAMP Pro中启用HTTP2支持?我想测试并改进一些本地开发网站,以支持HTTP2。
我已经搜索了一段时间,但没有找到任何解决方案。
最近我在MAMP Pro与NGINX上为NodeJS APP配置了HTTP2。我写了一篇短文,讲述了这个过程,你可以在https://www.linkedin.com/pulse/nodejs-http2-server-mamp-pro-nginx-sergei-iastrebov/ 上阅读。我相信这会对你有所帮助。
对于 MAMP Pro v4.0.0
C:\>F:\MAMP\bin\nginx\nginx.exe -V
nginx version: nginx/1.13.1
built by cl 16.00.40219.01 for 80x86
built with OpenSSL 1.0.1m 19 Mar 2015
TLS SNI support enabled
configure arguments: --with-cc=cl --builddir=objs --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe
--http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs/lib/pcre --with-zl
ib=objs/lib/zlib --with-openssl=objs/lib/openssl --with-select_module --with-http_ssl_module --add-module=c:/MinGW/msys/1.0/home/Nebojsa/subsmodule/ngx_http_substitutions_filter_module
Nginx没有构建HTTP2
支持
C:\>F:\MAMP\bin\apache\bin\httpd.exe -V
Server version: Apache/2.2.31 (Win32)
Server built: May 6 2016 10:19:53
Server's Module Magic Number: 20051115:40
Server loaded: APR 1.5.2, APR-Util 1.5.4
Compiled using: APR 1.5.2, APR-Util 1.5.4
Architecture: 32-bit
Server MPM: WinNT
threaded: yes (fixed thread count)
forked: no
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/winnt"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/apache"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error.log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Apache模块mod_http2
可用语言:en
描述:支持HTTP/2传输层
状态:扩展
模块标识符:http2_module
源文件:mod_http2.c
兼容性:在版本2.4.17及更高版本中可用
MAMP Pro 4使用Apache 2.2.31
未达到Apache的最小版本要求。
因此,您无法使用HTTP2模块。最好使用其他新版本的Apache通过docker或直接使用来处理HTTP2。
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";