支持https请求-openssl生成ssl证书
x509证书一般会用到三类文,key,csr,crt。
Key 是私用密钥openssl格,通常是rsa算法。
Csr 是证书请求文件,用于申请证书。在制作csr文件的时,必须使用自己的私钥来签署申,还可以设定一个密钥。
crt是CA认证后的证书文,(windows下面的,其实是crt),签署人用自己的key给你签署的凭证。
1.key的生成
openssl genrsa -des3 -out server.key 2048
这样是生成rsa私钥,des3算法,openssl格式,2048位强度。server.key是密钥文件名。为了生成这样的密钥,需要一个至少四位的密码。可以通过以下方法生成没有密码的key:
openssl rsa -in server.key -out server.key
server.key就是没有密码的版本了。
2. 生成CA的crt
openssl req -new -x509 -key server.key -out ca.crt -days 3650
生成的ca.crt文件是用来签署下面的server.csr文件。
3. csr的生成方法
openssl req -new -key server.key -out server.csr
需要依次输入国家,地区,组织,email。最重要的是有一个common name,可以写你的名字或者域名。如果为了https申请,这个必须和域名吻合,否则会引发浏览器警报。生成的csr文件交给CA签名后形成服务端自己的证书。
4. crt生成方法
CSR文件必须有CA的签名才可形成证书,可将此文件发送到verisign等地方由它验证,要交一大笔钱,何不自己做CA呢。
openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey server.key -CAcreateserial -out server.crt
输入key的密钥后,完成证书生成。-CA选项指明用于被签名的csr证书,-CAkey选项指明用于签名的密钥,-CAserial指明序列号文件,而-CAcreateserial指明文件不存在时自动生成。
最后生成了私用密钥:server.key和自己认证的SSL证书:server.crt
证书合并:
cat server.key server.crt > server.pem
nginx配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 |
user root; worker_processes 5; events { worker_connections 1024; } http { server_tokens off; include mime.types; default_type application/octet-stream; sendfile on; client_max_body_size 1024M; fastcgi_read_timeout 1200; keepalive_timeout 1200; server { listen 80; #listen [::]:80;ectranslate.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } server { listen 80; #listen [::]:80; server_name notify.ectranslate.cn; listen 443; ssl on; ssl_certificate /usr/local/nginx/conf/server-cn.crt; ssl_certificate_key /usr/local/nginx/conf/server-cn.key; location / { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } server { listen 80; #listen [::]:80; server_name notify.ectranslate.com; listen 443; ssl on; ssl_certificate /usr/local/nginx/conf/server.crt; ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; location / { proxy_pass https://127.0.0.1:3005; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } server { listen 80; server_name 127.0.0.1; location /phpfpm_status { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } } server { listen 80; #listen [::]:80; server_name chat.ectranslate.cn; listen 443; ssl on; ssl_certificate /usr/local/nginx/conf/server-cn.crt; ssl_certificate_key /usr/local/nginx/conf/server-cn.key; location / { proxy_pass http://127.0.0.1:3002; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } server { listen 80; #listen [::]:80; server_name chat.ectranslate.com; listen 443; ssl on; ssl_certificate /usr/local/nginx/conf/server.crt; ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; location / { proxy_pass https://127.0.0.1:3007; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } server { listen 80; #listen [::]:80; server_name support.ectranslate.cn; location / { proxy_pass http://192.168.24.230; } } server { listen 80; #listen [::]:80; listen 443; server_name www.ectranslate.cn ectranslate.cn; ssl on; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; if ($host = 'ectranslate.cn' ) { rewrite ^/(.*)$ https://www.ectranslate.cn/$1 permanent; } if ($host = '$server_port = 80' ) { return 301 https://$server_name$request_uri; } if ($scheme = http) { return 301 https://$server_name$request_uri; } charset utf-8; access_log logs/client.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/zh-cn/07_Home; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; listen 443; server_name translator.ectranslate.cn; if ($host = 'ectranslate.cn' ) { rewrite ^/(.*)$ https://translator.ectranslate.cn/$1 permanent; } if ($host = '$server_port = 80' ) { return 301 https://$server_name$request_uri; } if ($scheme = http) { return 301 https://$server_name$request_uri; } ssl on; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; charset utf-8; access_log logs/translator.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/zh-cn/01_Translator; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; server_name client.ectranslate.cn; listen 443; if ($host = 'ectranslate.cn' ) { rewrite ^/(.*)$ https://client.ectranslate.cn/$1 permanent; } if ($host = '$server_port = 80' ) { return 301 https://$server_name$request_uri; } if ($scheme = http) { return 301 https://$server_name$request_uri; } ssl on; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; charset utf-8; access_log logs/client.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/zh-cn/02_Customer; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; server_name passport.ectranslate.cn; listen 443; if ($host = 'ectranslate.cn' ) { rewrite ^/(.*)$ https://passport.ectranslate.cn/$1 permanent; } if ($host = '$server_port = 80' ) { return 301 https://$server_name$request_uri; } if ($scheme = http) { return 301 https://$server_name$request_uri; } ssl on; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; charset utf-8; access_log logs/passport.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/zh-cn/06_Passport; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; server_name plus.ectranslate.cn; charset utf-8; access_log logs/client.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/zh-cn/09_BBS; #include other.conf; location / { rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last; rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last; rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last; rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last; rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last; rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last; rewrite ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last; rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last; rewrite ^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3 last; if (!-e $request_filename) { return 404; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; server_name cms.ectranslate.cn; charset utf-8; access_log logs/client.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/zh-cn/13_CMS/wordpress; #include other.conf; location / { rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last; rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last; rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last; rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last; rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last; rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last; rewrite ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last; rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last; rewrite ^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3 last; if (!-e $request_filename) { return 404; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; server_name xmgnt.ectranslate.cn; charset utf-8; access_log logs/xmgnt.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/zh-cn/03_Admin; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; listen 443; server_name wapi.ectranslate.cn; charset utf-8; access_log logs/wapi.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/zh-cn/18_WiiAPI; ssl on; #ssl_certificate /usr/local/nginx/conf/server.crt; #ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; ssl_certificate /usr/local/nginx/conf/ectranslatecn.crt; ssl_certificate_key /usr/local/nginx/conf/ectranslatecn.key; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; listen 443; server_name test.ectranslate.com; charset utf-8; access_log logs/xmgnt.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/a; ssl on; ssl_certificate /usr/local/nginx/conf/server.crt; ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; listen 443; #listen [::]:80; server_name www.ectranslate.com ectranslate.com; if ($host = '$server_port = 80' ) { return 301 https://$server_name$request_uri; } if ($scheme = http) { return 301 https://$server_name$request_uri; } if ($host = 'ectranslate.com' ) { rewrite ^/(.*)$ https://www.ectranslate.com/$1 permanent; } charset utf-8; access_log logs/client.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/en-us/07_Home; ssl on; #ssl_certificate /usr/local/nginx/conf/server.crt; #ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; listen 443; #listen [::]:80; server_name translator.ectranslate.com; if ($host = '$server_port = 80' ) { return 301 https://$server_name$request_uri; } if ($scheme = http) { return 301 https://$server_name$request_uri; } if ($host = 'ectranslate.com' ) { rewrite ^/(.*)$ https://translator.ectranslate.com/$1 permanent; } charset utf-8; access_log logs/translator.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/en-us/01_Translator; ssl on; #ssl_certificate /usr/local/nginx/conf/server.crt; #ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; listen 443; server_name client.ectranslate.com; if ($host = '$server_port = 80' ) { return 301 https://$server_name$request_uri; } if ($scheme = http) { return 301 https://$server_name$request_uri; } if ($host = 'ectranslate.com' ) { rewrite ^/(.*)$ https://client.ectranslate.com/$1 permanent; } charset utf-8; access_log logs/client.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/en-us/02_Customer; ssl on; #ssl_certificate /usr/local/nginx/conf/server.crt; #ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; listen 443; server_name passport.ectranslate.com; if ($host = '$server_port = 80' ) { return 301 https://$server_name$request_uri; } if ($scheme = http) { return 301 https://$server_name$request_uri; } if ($host = 'ectranslate.com' ) { rewrite ^/(.*)$ https://passport.ectranslate.com/$1 permanent; } charset utf-8; access_log logs/passport.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/en-us/06_Passport; ssl on; #ssl_certificate /usr/local/nginx/conf/server.crt; #ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; listen 443; server_name wiitm.ectranslate.com; if ($host = '$server_port = 80' ) { return 301 https://$server_name$request_uri; } if ($scheme = http) { return 301 https://$server_name$request_uri; } if ($host = 'ectranslate.com' ) { rewrite ^/(.*)$ https://wiitm.ectranslate.com/$1 permanent; } charset utf-8; access_log logs/wiitm.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/en-us/10_WiiTM; ssl on; #ssl_certificate /usr/local/nginx/conf/server.crt; #ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; listen 443; server_name wiitmadmin.ectranslate.com; charset utf-8; if ($host = '$server_port = 80' ) { return 301 https://$server_name$request_uri; } if ($scheme = http) { return 301 https://$server_name$request_uri; } if ($host = 'ectranslate.com' ) { rewrite ^/(.*)$ https://wiitmadmin.ectranslate.com/$1 permanent; } access_log logs/wiitmadmin.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/en-us/11_WiiTMAdmin; ssl on; #ssl_certificate /usr/local/nginx/conf/server.crt; #ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; listen 443; server_name wiitmapi.ectranslate.com; charset utf-8; access_log logs/wiitmapi.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/en-us/15_WiiTMAPI; ssl on; #ssl_certificate /usr/local/nginx/conf/server.crt; #ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; listen 443; server_name xmgnt.ectranslate.com; charset utf-8; access_log logs/xmgnt.access.log; index index.html index.htm index.php; root /usr/local/nginx/html/en-us/03_Admin; ssl on; ssl_certificate /usr/local/nginx/conf/server.crt; ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; #include other.conf; location / { if (!-e $request_filename) { rewrite ^/Public/(.*)$ /Public/$1 last; rewrite ^/(.*)$ /index.php/$1 last; break; } } #error_page 404 /404.html; location ~ \.php { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } } server { listen 80; #listen [::]:80; listen 443; server_name support.ectranslate.com; ssl on; #ssl_certificate /usr/local/nginx/conf/server.crt; #ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key; ssl_certificate /usr/local/nginx/conf/testwiitrans.crt; ssl_certificate_key /usr/local/nginx/conf/testwiitrans.key; location / { #proxy_pass https://192.168.24.230; proxy_pass http://192.168.24.230; } } } |
发表评论