精华内容
下载资源
问答
  • 2、记录值解析到一级域名对应端口 (阿里云的好像不太灵) 、Apache配置代理: 1、http.conf: NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin liang.top ServerName...

    一,简单配置方法:

     

     

    1、记录类型选择隐形URL

    2、记录值解析到一级域名对应的端口

    (阿里云的好像不太灵)

    二、Apache配置代理:

     1、http.conf:

    NameVirtualHost *:80
    <VirtualHost *:80>
            ServerAdmin liang.top
            ServerName www.ccc.top
            ServerAlias ccc
    
    </VirtualHost>
    
    #<VirtualHost *:80>
    #        ServerAdmin share.top
    #        ServerName share.ccc.top
    #        ServerAlias ccc_share
    #        ProxyPass "/" "http://127.0.0.1:8880/"
    #        ProxyPassReverse "/" "http://127.0.0.1:8880/"
    #</VirtualHost>
    
    <VirtualHost *:80>
            ServerAdmin transcode.top
            ServerName transcode.cccc.top
            ServerAlias ccc_transcode
    
    
            ProxyPass "/" "http://transcode.cccc.top:8881/"
            ProxyPassReverse "/" "http://transcode.cccc.top:8881/"
    
    
    </VirtualHost>

    三、加一个https的配置:

    #
    # When we also provide SSL we have to listen to the 
    # the HTTPS port in addition.
    #
    Listen 443 https
    
    ##
    ##  SSL Global Context
    ##
    ##  All SSL configuration in this context applies both to
    ##  the main server and all SSL-enabled virtual hosts.
    ##
    
    #   Pass Phrase Dialog:
    #   Configure the pass phrase gathering process.
    #   The filtering dialog program (`builtin' is a internal
    #   terminal dialog) has to provide the pass phrase on stdout.
    SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
    
    #   Inter-Process Session Cache:
    #   Configure the SSL Session Cache: First the mechanism 
    #   to use and second the expiring timeout (in seconds).
    SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
    SSLSessionCacheTimeout  300
    
    #   Pseudo Random Number Generator (PRNG):
    #   Configure one or more sources to seed the PRNG of the 
    #   SSL library. The seed data should be of good random quality.
    #   WARNING! On some platforms /dev/random blocks if not enough entropy
    #   is available. This means you then cannot use the /dev/random device
    #   because it would lead to very long connection times (as long as
    #   it requires to make more entropy available). But usually those
    #   platforms additionally provide a /dev/urandom device which doesn't
    #   block. So, if available, use this one instead. Read the mod_ssl User
    #   Manual for more details.
    SSLRandomSeed startup file:/dev/urandom  256
    SSLRandomSeed connect builtin
    #SSLRandomSeed startup file:/dev/random  512
    #SSLRandomSeed connect file:/dev/random  512
    #SSLRandomSeed connect file:/dev/urandom 512
    
    #
    # Use "SSLCryptoDevice" to enable any supported hardware
    # accelerators. Use "openssl engine -v" to list supported
    # engine names.  NOTE: If you enable an accelerator and the
    # server does not start, consult the error logs and ensure
    # your accelerator is functioning properly. 
    #
    SSLCryptoDevice builtin
    #SSLCryptoDevice ubsec
    
    ##
    ## SSL Virtual Host Context
    ##
    
    <VirtualHost *:443>
    
    # General setup for the virtual host, inherited from global configuration
    DocumentRoot "/var/www/html"
    ServerName www.cccc.top:443
    
    # Use separate log files for the SSL virtual host; note that LogLevel
    # is not inherited from httpd.conf.
    ErrorLog logs/ssl_error_log
    TransferLog logs/ssl_access_log
    LogLevel warn
    
    #   SSL Engine Switch:
    #   Enable/Disable SSL for this virtual host.
    SSLEngine on
    
    #   SSL Protocol support:
    # List the enable protocol levels with which clients will be able to
    # connect.  Disable SSLv2 access by default:
    SSLProtocol all -SSLv2 -SSLv3
    
    #   SSL Cipher Suite:
    #   List the ciphers that the client is permitted to negotiate.
    #   See the mod_ssl documentation for a complete list.
    SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA
    
    #   Speed-optimized SSL Cipher configuration:
    #   If speed is your main concern (on busy HTTPS servers e.g.),
    #   you might want to force clients to specific, performance
    #   optimized ciphers. In this case, prepend those ciphers
    #   to the SSLCipherSuite list, and enable SSLHonorCipherOrder.
    #   Caveat: by giving precedence to RC4-SHA and AES128-SHA
    #   (as in the example below), most connections will no longer
    #   have perfect forward secrecy - if the server's key is
    #   compromised, captures of past or future traffic must be
    #   considered compromised, too.
    #SSLCipherSuite RC4-SHA:AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5
    SSLHonorCipherOrder on
    
    #   Server Certificate:
    # Point SSLCertificateFile at a PEM encoded certificate.  If
    # the certificate is encrypted, then you will be prompted for a
    # pass phrase.  Note that a kill -HUP will prompt again.  A new
    # certificate can be generated using the genkey(1) command.
    SSLCertificateFile /etc/httpd/cert/www.cccc.top_public.crt
    
    #   Server Private Key:
    #   If the key is not combined with the certificate, use this
    #   directive to point at the key file.  Keep in mind that if
    #   you've both a RSA and a DSA private key you can configure
    #   both in parallel (to also allow the use of DSA ciphers, etc.)
    SSLCertificateKeyFile /etc/httpd/cert/www.cccc.top.key
    
    #   Server Certificate Chain:
    #   Point SSLCertificateChainFile at a file containing the
    #   concatenation of PEM encoded CA certificates which form the
    #   certificate chain for the server certificate. Alternatively
    #   the referenced file can be the same as SSLCertificateFil
    #   when the CA certificates are directly appended to the server
    #   certificate for convinience.
    SSLCertificateChainFile /etc/httpd/cert/www.cccc.top_chain.crt
    
    #   Certificate Authority (CA):
    #   Set the CA certificate verification path where to find CA
    #   certificates for client authentication or alternatively one
    #   huge file containing all of them (file must be PEM encoded)
    #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
    
    #   Client Authentication (Type):
    #   Client certificate verification type and depth.  Types are
    #   none, optional, require and optional_no_ca.  Depth is a
    #   number which specifies how deeply to verify the certificate
    #   issuer chain before deciding the certificate is not valid.
    #SSLVerifyClient require
    #SSLVerifyDepth  10
    
    #   Access Control:
    #   With SSLRequire you can do per-directory access control based
    #   on arbitrary complex boolean expressions containing server
    #   variable checks and other lookup directives.  The syntax is a
    #   mixture between C and Perl.  See the mod_ssl documentation
    #   for more details.
    #<Location />
    #SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
    #            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
    #            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
    #            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
    #            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
    #           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
    #</Location>
    
    #   SSL Engine Options:
    #   Set various options for the SSL engine.
    #   o FakeBasicAuth:
    #     Translate the client X.509 into a Basic Authorisation.  This means that
    #     the standard Auth/DBMAuth methods can be used for access control.  The
    #     user name is the `one line' version of the client's X.509 certificate.
    #     Note that no password is obtained from the user. Every entry in the user
    #     file needs this password: `xxj31ZMTZzkVA'.
    #   o ExportCertData:
    #     This exports two additional environment variables: SSL_CLIENT_CERT and
    #     SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
    #     server (always existing) and the client (only existing when client
    #     authentication is used). This can be used to import the certificates
    #     into CGI scripts.
    #   o StdEnvVars:
    #     This exports the standard SSL/TLS related `SSL_*' environment variables.
    #     Per default this exportation is switched off for performance reasons,
    #     because the extraction step is an expensive operation and is usually
    #     useless for serving static content. So one usually enables the
    #     exportation for CGI and SSI requests only.
    #   o StrictRequire:
    #     This denies access when "SSLRequireSSL" or "SSLRequire" applied even
    #     under a "Satisfy any" situation, i.e. when it applies access is denied
    #     and no other module can change it.
    #   o OptRenegotiate:
    #     This enables optimized SSL connection renegotiation handling when SSL
    #     directives are used in per-directory context. 
    #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
    <Files ~ "\.(cgi|shtml|phtml|php3?)$">
        SSLOptions +StdEnvVars
    </Files>
    <Directory "/var/www/cgi-bin">
        SSLOptions +StdEnvVars
    </Directory>
    
    #   SSL Protocol Adjustments:
    #   The safe and default but still SSL/TLS standard compliant shutdown
    #   approach is that mod_ssl sends the close notify alert but doesn't wait for
    #   the close notify alert from client. When you need a different shutdown
    #   approach you can use one of the following variables:
    #   o ssl-unclean-shutdown:
    #     This forces an unclean shutdown when the connection is closed, i.e. no
    #     SSL close notify alert is send or allowed to received.  This violates
    #     the SSL/TLS standard but is needed for some brain-dead browsers. Use
    #     this when you receive I/O errors because of the standard approach where
    #     mod_ssl sends the close notify alert.
    #   o ssl-accurate-shutdown:
    #     This forces an accurate shutdown when the connection is closed, i.e. a
    #     SSL close notify alert is send and mod_ssl waits for the close notify
    #     alert of the client. This is 100% SSL/TLS standard compliant, but in
    #     practice often causes hanging connections with brain-dead browsers. Use
    #     this only for browsers where you know that their SSL implementation
    #     works correctly. 
    #   Notice: Most problems of broken clients are also related to the HTTP
    #   keep-alive facility, so you usually additionally want to disable
    #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
    #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
    #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
    #   "force-response-1.0" for this.
    BrowserMatch "MSIE [2-5]" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0
    
    #   Per-Server Logging:
    #   The home of a custom SSL log file. Use this when you want a
    #   compact non-error SSL logfile on a virtual host basis.
    CustomLog logs/ssl_request_log \
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    
     ProxyPass "/ww" "http://127.0.0.1:8899/ww"
     ProxyPassReverse "/ww" "http://127.0.0.1:8899/ww"
     # ProxyPass "/" "http://127.0.0.1:16800/"
     # ProxyPassReverse "/" "http://127.0.0.1:16800/"
    
    
    </VirtualHost>
    

      

    转载于:https://www.cnblogs.com/liangblog/p/11515532.html

    展开全文
  • 配置二级域名同IP不同端口

    千次阅读 2018-11-02 16:39:00
    配置二级域名同IP不同端口 1、记录类型选择隐形URL 2、记录值解析到一级域名对应的端口 posted on 2018-11-02 16:39 三天打鱼,两天晒网 阅读(...) 评论(.....

     

    1、记录类型选择隐形URL

    2、记录值解析到一级域名对应的端口

     

    posted on 2018-11-02 16:39 三天打鱼,两天晒网 阅读(...) 评论(...) 编辑 收藏

    转载于:https://www.cnblogs.com/yanketao/p/9897042.html

    展开全文
  • 个人服务器,同一个IP服务器下不同端口对应不同的Java服务,通过二级域名绑定不同端口,实现功能划分。 二、技术: Nginx代理服务器 三、参数配置 四、重启服务 /etc/nginx/sbin/nginx -t --检查配置文件 /...

    一、背景:

    个人服务器,同一个IP服务器下不同端口对应不同的Java服务,通过二级域名绑定不同端口,实现功能划分。

    二、技术:

    Nginx代理服务器

    三、参数配置示例:

    主要是 server_name 和 location 配置

        server {
            listen 80;
            listen [::]:80;
            server_name www.jiangshikai.cn;
            return 301 https://www.jiangshikai.cn$request_uri;
        }
        server {
            listen 80;
            listen [::]:80;
            server_name pdf.jiangshikai.cn;
            location / {
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header Host $http_host;
                    proxy_pass http://127.0.0.1:8081;
        }
        server {
            listen 80;
            listen [::]:80;
            server_name word.jiangshikai.cn;
            location / {
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header Host $http_host;
                    proxy_pass http://127.0.0.1:8082;
        }
        server {
            listen 80;
            listen [::]:80;
            server_name jpg.jiangshikai.cn;
            location / {
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header Host $http_host;
                    proxy_pass http://127.0.0.1:8083;
        }

    四、重启服务

     /etc/nginx/sbin/nginx -t    --检查配置文件

     /etc/nginx/sbin/nginx -s reload    --重新加载配置

    systemctl restart nginx    --重启Nginx

     

    展开全文
  • 一个ip 不同端口如何对应不同域名

    千次阅读 2019-04-15 22:03:37
    有多个二级域名分别对应不同端口的处理办法 在/etc/nginx/conf.d/下面需要新建文件 j.conf server { listen 80; server_name j.nidebobo.com; location / { proxy_set_header X-Real-IP $remote_addr;...
    • 有多个二级域名分别对应不同的端口的处理办法
    • /etc/nginx/conf.d/下面需要新建文件
    • j.conf
    • server {  
          listen 80;
          server_name j.nidebobo.com;
      
          location / {
              proxy_set_header   X-Real-IP $remote_addr;
              proxy_set_header   Host      $http_host;
              proxy_pass         http://0.0.0.0:8080;
          }
      }
    • 在服务器所在云将j.nidebobo.com 解析到对应ip即可 
    展开全文
  • 使用 nginx 配置二级域名

    千次阅读 2018-08-14 12:56:42
    两个用于站点的文件夹位于完全不同的路径,需要使用不同二级域名可以各自访问对应的站点页面。 方法 配置 nginx “虚拟主机”的用法很灵活,只需要在一份配置 nginx 的 test.conf 文件中指定站点文件所在的...
  • 二级域名之间共享cookie

    千次阅读 2017-04-12 19:57:57
    也就是说二级域名(或者三级域名)之间可以通过这种方式共享cookie。 其实cookie的domain属性的用法跟path有些类似,比如我们将cookie的path设置为/,则/user目录下也可以访问该cookie。实践Apache同一端口对应不同...
  • 基本是一些概念,不过看了这些东西基本理解了泛解析和泛...简单的说就是,将不同的网站空间对应不同域名,以连接请求中的域名字段来分发和应答正确的对应空间的文件执行结果。 举个例子来说,一台服务器ip地址为19
  • 本文实例讲述了PHP+Apache实现二级域名之间共享cookie的方法。分享给大家供大家参考,具体如下: 简介 ... 也就是说二级域名(或者三级...Apache同一端口对应不同域名 httpd-vhosts.conf <VirtualHost 127.0.0.1:80
  • 然后下载对应的证书(选择Nginx下载方式)(此处,证书绑定的是二级域名) 3、将证书放到 D:\nginx-1.18.0\conf\cert目录下(cert 目录需新建),如下图: 4、配置nginx.conf文件如下:(注意:此处需要将http请求...
  • 跨域

    2019-06-13 11:11:08
    1.跨域的原因 JavaScript出于安全方面的考虑,不允许跨域调用其他页面...同一域名,不同二级域名 不同域名 3.跨域 跨域指的是浏览器不能执行其他网站的脚本。它是由浏览器的同源策略造成的,是浏览器对JavaScript施...
  • 首先什么是跨域【概念:只要协议、域名、端口有任何一个不同,都被当作是不同的域。】: 1、同一域名下 允许;...7、同一域名,不同二级域名(同上) 不允许(cookie这种情况下也不允许访问; 8、不同域名 不允
  • SpringBoot解决跨域问题

    千次阅读 2020-08-10 13:18:56
    分享知识 传递快乐 前后端分离是目前的趋势, 解决跨域问题也是老生常谈的话题了,我们了解一下什么是域和跨域。 域:协议 + 域名 + 端口;三者完全相同则为同域,反之有其一不同均为不同... 同一域名不同二级..
  • 配置文件端口修改为不同,ip加端口能够访问对应项目,配的二级域名无法访问对应的项目 多个配置文件端口都为80,域名不同,然后会出现问题: [warn] _default_ VirtualHost overlap on port 80, the first has ...
  • 前端跨域简单理解

    2017-04-12 11:35:21
    www.a.com与a.com(同一域名,不同二级域名) chs.a.com与en.a.com(主域名相同,子域名不同) a.com与70.32.92.74(对应ip地址) 2.协议不同,例如:http协议与https协议3.端口不同,例如:a.com:80与a.com:8080...
  • 原文地址: ...三种方式: (1)多IP(一台主机有多个网卡...(2)多个二级域名,所有二级域名指向同一个IP,但对应不同的目录,这种情 况下只能通过域名访问而不能通过IP访问; (3)为每个目录设置不同的端口映射。 ...
  • 章 Linux I/O端口编程 22.1 如何在C语言下使用I/O端口 22.1.1 一般的方法 22.1.2 另一个替代方法:/dev/prot 22.2 硬件中断与DMA存取 22.3 高精确的时间 22.3.1 延迟时间 22.3.2 时间的测量 22.4 使用其他...
  • 跨域问题

    2019-04-17 08:44:00
    1.为什么会出现跨域问题?  浏览器的同源策略限制,浏览器会拒绝跨域(拒绝读操作)请求。【服务器与服务器之间的数据请求不会...【二级域名不同也属于不同主机】  域名和域名对应IP地址【http://www.test.com ...
  • 高并发解决方案

    2021-02-23 20:11:01
    DNS域名解析就是将域名转化为不需要显示IP、端口二级域名端口一般为80)的IP地址,域名解析的一般先去本地环境的host文件读取配置,解析成对应的IP地址,根据IP地址访问对应的服务器。若host文件未配置,则会去...
  • 一、什么是跨域 同一个ip、同一个网络协议、同一个端口,三者都满足就是同一个域,否则就是跨域。 二、为什么会跨域 基于两个方面: ...主域名:https://www.baidu.com/,二级域名:http://image.baidu.com...
  • 篇 Linux高级语言及管理编程 第5章 外壳编程 35 5.1 创建和运行外壳程序 35 5.1.1 创建外壳程序 35 5.1.2 运行外壳程序 35 5.2 使用外壳变量 36 5.2.1 给变量赋值 36 5.2.2 读取变量的值 37 5.2.3 位置变量和...
  • Day93 Nginx

    2020-05-12 23:03:03
    使用域名访问本地项目 统一环境:实际开发中,会有不同的环境。如果不同环境使用不同的ip去访问,可能会出现一些问题。为了保证所有环境的一致,我们会在各种... 域名(购买一个主域名后,其可以解析无数个二级域名
  • 什么是跨域 一句话:同一个ip、同一个网络协议、同一个端口,三者都满足就是同一个域,否则就是跨域。 为什么非得跨域 基于两个方面: a. web应用本身是部署在不同的服务器上 ...二级域名:http://image.baidu...
  • 服务器外网IP绑定的一个顶级域名指向Java项目,此顶级域名解析出的一个二级域名指向php项目。设置Apache和Tomcat监听不同端口。通过Nginx的请求转发,把用户请求(访问链接)转发到对应的端口去处理即可实现此需求。一...
  • 什么是跨域 一句话:同一个ip、同一个网络协议、同一个端口,三者都满足就是同一个域,否则就是跨域。 为什么非得跨域 基于两个方面: a. web应用本身是部署在不同的服务器...二级域名:http://image.baidu.com/, ...
  • 作者:王森什么是跨域一句话:同一个ip、同一个网络协议、同一个端口,三者都满足就是同一个域,否则就是跨域。为什么非得跨域基于两个...主域名:https://www.baidu.com/二级域名:http://image.baidu.com/, ht...
  • 服务器外网IP绑定的一个顶级域名指向Java项目,此顶级域名解析出的一个二级域名指向php项目。设置Apache和Tomcat监听不同端口。通过Nginx的请求转发,把用户请求(访问链接)转发到对应的端口去处理即可实现此需求。...

空空如也

空空如也

1 2
收藏数 35
精华内容 14
关键字:

不同二级域名对应不同端口